修改了用户登录时的返回状态

This commit is contained in:
DESKTOP-4U0TDEF\20371 2021-07-14 09:49:12 +08:00
parent a71146fa73
commit 046996bb78

View File

@ -69,17 +69,17 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
// 检查用户是否存在
if(userEntity == null){
throw new BadCredentialsException("user don't exist");
throw new BadCredentialsException("账号不存在或错误,请您确认注册");
}
// 检查用户是否激活
if(userEntity.getActiveFlag().intValue() != 0){
throw new DisabledException("user not activated");
throw new DisabledException("该账号还未激活,请联系管理员");
}
//检查用户状态是否正常
if(userEntity.getStatusCode() != 0){
throw new DisabledException("user state exception");
throw new DisabledException("用户状态不正常,请联系管理员");
}
// 认证逻辑
@ -97,7 +97,7 @@ public class CustomAuthenticationProvider implements AuthenticationProvider {
return authToken;
}
else {
throw new BadCredentialsException("user password error");
throw new BadCredentialsException("用户密码错误,请重新输入");
}
}