master
肖凡 2023-11-17 08:32:22 +08:00
parent ce5c492d7e
commit 2bdb69ccbc
9 changed files with 9 additions and 1 deletions

View File

@ -71,7 +71,10 @@ public class AuthServiceimpl implements AuthService{
return Result.error("密码不能为空");
}
if (!vailPwd(loginRequest.getUserPwd())){
return Result.error("密码格式错误");
return Result.error("密码最少六位,包含一个大写字母和一个小写字母和一个数字和一个特殊字符");
}
if (vailPwd2(loginRequest.getUserPwd())){
return Result.error("密码不能为空");
}
String userKey = UUID.randomUUID().toString().replaceAll("-", "");
@ -105,4 +108,9 @@ public class AuthServiceimpl implements AuthService{
return compile.matcher(userPwd).matches();
}
public Boolean vailPwd2(String userPwd){
Pattern compile = Pattern.compile("^$");
return compile.matcher(userPwd).matches();
}
}