|
|
@@ -10,16 +10,17 @@ class stringUtil
|
|
|
|
|
|
const KEY = 'Aos4eLEmqpo8dmJleG610tR1KxUVQ5OzgkzpYM23PLqwSaU3Io';
|
|
|
|
|
|
- public static function passwordLevel($password)
|
|
|
+ public static function passwordCheck($password)
|
|
|
{
|
|
|
if (preg_match('/^([0-9]{6,16})$/', $password)) {
|
|
|
- return 0;
|
|
|
- } else if (preg_match('/^[0-9 a-z]{6,16}$/', $password)) {
|
|
|
- return 1;
|
|
|
- } else if (preg_match('/^[0-9 a-z A-Z !.@#$%^&*]{6,16}$/', $password)) {
|
|
|
- return 2;
|
|
|
+ util::fail('密码不能纯数字');
|
|
|
+ }
|
|
|
+ if (preg_match('/^[a-z A-Z]{6,16}$/', $password)) {
|
|
|
+ util::fail('密码不能纯字母');
|
|
|
+ }
|
|
|
+ if (strlen($password) < 6) {
|
|
|
+ util::fail('密码必须大于6位');
|
|
|
}
|
|
|
- return 0;
|
|
|
}
|
|
|
|
|
|
//随机编号,英文开头,用于鲜花商品编号
|