|
@@ -53,18 +53,10 @@ public class RegisterUtil {
|
|
|
if (userName.length() > USER_NAME_LENGTH_MAX) {
|
|
|
return HttpStatusEnum.USERNAME_TOO_LONG;
|
|
|
}
|
|
|
-// boolean matches = username.matches("[\\s]");
|
|
|
-// if (!username.matches("/^[a-zA-Z0-9]+$/i")){
|
|
|
-// return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
-// }
|
|
|
-// //合规验证
|
|
|
-// if (username.matches("/\\s/") || username.matches("/^ZN/i") || !username.matches("^[a-zA-Z0-9]+$")) {
|
|
|
-// return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
-// }
|
|
|
-// //用户名不是手机号, 用户名只能是数字和字母
|
|
|
-// if (!StringUtils.checkPhone(username) && !username.matches("/^(?![^a-zA-Z]+$).{4,32}$/")) {
|
|
|
-// return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
-// }
|
|
|
+ //用户名只能是数字字母组合
|
|
|
+ if (userName.matches("/\\s/") || !userName.matches("^A-Za-20-9]+$")) {
|
|
|
+ return HttpStatusEnum.USERNAME_BAD_CHAR;
|
|
|
+ }
|
|
|
//密码验证
|
|
|
return HttpStatusEnum.SUCCESS;
|
|
|
}
|
|
@@ -85,9 +77,9 @@ public class RegisterUtil {
|
|
|
if (password.length() > PASSWORD_LENGTH_MAX) {
|
|
|
return HttpStatusEnum.PASSWORD_TOO_LONG;
|
|
|
}
|
|
|
-// if (password.matches("/\\s/") || !password.matches("A([a-zA-Z0-9~`#$%^&*!@.,()\\\\{}|:;?<>]){6,32}$")) {
|
|
|
-// return HttpStatusEnum.PASSWORD_BAD_CHAR;
|
|
|
-// }
|
|
|
+ if (password.matches("/\\s/") || !password.matches("^A-Za-20-9]+$")) {
|
|
|
+ return HttpStatusEnum.PASSWORD_BAD_CHAR;
|
|
|
+ }
|
|
|
return HttpStatusEnum.SUCCESS;
|
|
|
}
|
|
|
|