Commit c0b0b78d authored by liuyuzhen's avatar liuyuzhen

密码长度为题

parent 8e7d2b58
...@@ -85,6 +85,15 @@ class Validate{ ...@@ -85,6 +85,15 @@ class Validate{
return true; 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){ public static function checkPassword($password){
if(!$password){ if(!$password){
......
...@@ -384,8 +384,11 @@ class MemberModel extends \DAO\AbstractModel ...@@ -384,8 +384,11 @@ class MemberModel extends \DAO\AbstractModel
if (!$where['password']) { if (!$where['password']) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyPassword); \Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyPassword);
} }
if (!\Our\Validate::checkPassword($where['password'])) { /*if (!\Our\Validate::checkPassword($where['password'])) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::passwordLimit); \Error\ErrorModel::throwException(\Error\CodeConfigModel::passwordLimit);
}*/
if (!\Our\Validate::checkPasswordLen($where['password'])) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::passwordLenLimit);
} }
if (!$where['deviceType']) { if (!$where['deviceType']) {
\Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyDeviceType); \Error\ErrorModel::throwException(\Error\CodeConfigModel::emptyDeviceType);
......
...@@ -104,6 +104,7 @@ class CodeConfigModel ...@@ -104,6 +104,7 @@ class CodeConfigModel
const sellerNameUpdateFailed = 10116; const sellerNameUpdateFailed = 10116;
const notHaveAccess = 10117; const notHaveAccess = 10117;
const sellerJoinUpdateFailed = 10118; const sellerJoinUpdateFailed = 10118;
const passwordLenLimit = 10119;
//访问错误 //访问错误
const illegalAccess = 200001; const illegalAccess = 200001;
...@@ -536,6 +537,7 @@ class CodeConfigModel ...@@ -536,6 +537,7 @@ class CodeConfigModel
self::sellerNameUpdateFailed => '更换手机时卖家手机号码更新失败', self::sellerNameUpdateFailed => '更换手机时卖家手机号码更新失败',
self::notHaveAccess => '您没有权限使用', self::notHaveAccess => '您没有权限使用',
self::sellerJoinUpdateFailed => '更换手机时卖家手机号码更新失败', self::sellerJoinUpdateFailed => '更换手机时卖家手机号码更新失败',
self::passwordLenLimit => '密码为6~16位的数字或字母组合',
//商品相关 //商品相关
self::emptyCommonId => '商品主键不能为空', self::emptyCommonId => '商品主键不能为空',
self::goodsNotExist => '商品不存在', 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