This commit is contained in:
shiziyuan9527 2020-06-04 18:51:48 +08:00
parent 285037e475
commit 1304459791
2 changed files with 8 additions and 8 deletions

View File

@ -68,19 +68,19 @@ public class LoginController {
return ResultHolder.error(Translator.get("login_fail"));
}
} catch (ExcessiveAttemptsException e) {
msg = "excessive_attempts";
msg = Translator.get("excessive_attempts");
} catch (LockedAccountException e) {
msg = "user_locked";
msg = Translator.get("user_locked");
} catch (DisabledAccountException e) {
msg = "user_has_been_disabled ";
msg = Translator.get("user_has_been_disabled");
} catch (ExpiredCredentialsException e) {
msg = "user_expires. ";
msg = Translator.get("user_expires");
} catch (AuthenticationException e) {
msg = e.getMessage();
} catch (UnauthorizedException e) {
msg = "not_authorized" + e.getMessage();
msg = Translator.get("not_authorized") + e.getMessage();
}
return ResultHolder.error(Translator.get(msg));
return ResultHolder.error(msg);
}
@GetMapping(value = "/signout")

View File

@ -68,9 +68,9 @@ public class ShiroDBRealm extends AuthorizingRealm {
UserDTO user = userService.getUserDTO(userId);
String msg;
if (user == null) {
msg = Translator.get("user_not_exist") + userId;
msg = "The user does not exist: " + userId;
logger.warn(msg);
throw new UnknownAccountException(msg);
throw new UnknownAccountException(Translator.get("user_not_exist") + userId);
}
// local test
if (StringUtils.equals("local", runMode)) {