Commit c0b0b78d authored by liuyuzhen's avatar liuyuzhen

密码长度为题

parent 8e7d2b58
......@@ -85,6 +85,15 @@ class Validate{
return true;
}
public static function checkPasswordLen($password, $minLen = 6, $maxLen = 16){
if(!$password){
return false;
}
if(strlen($password) >= $minLen&&strlen($password) <= $maxLen){
return true;
}
return false;
}
public static function checkPassword($password){
if(!$password){
......
......@@ -384,8 +384,11 @@ class MemberModel extends \DAO\AbstractModel
if (!$where['password']) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyPassword);
}
if (!\Our\Validate::checkPassword($where['password'])) {
/*if (!\Our\Validate::checkPassword($where['password'])) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::passwordLimit);
}*/
if (!\Our\Validate::checkPasswordLen($where['password'])) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::passwordLenLimit);
}
if (!$where['deviceType']) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyDeviceType);
......
......@@ -104,6 +104,7 @@ class CodeConfigModel
const sellerNameUpdateFailed = 10116;
const notHaveAccess = 10117;
const sellerJoinUpdateFailed = 10118;
const passwordLenLimit = 10119;
//访问错误
const illegalAccess = 200001;
......@@ -536,6 +537,7 @@ class CodeConfigModel
self::sellerNameUpdateFailed => '更换手机时卖家手机号码更新失败',
self::notHaveAccess => '您没有权限使用',
self::sellerJoinUpdateFailed => '更换手机时卖家手机号码更新失败',
self::passwordLenLimit => '密码为6~16位的数字或字母组合',
//商品相关
self::emptyCommonId => '商品主键不能为空',
self::goodsNotExist => '商品不存在',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment