'登陆国际化修改'

This commit is contained in:
wenyann 2020-06-04 14:43:27 +08:00
parent 381189cb39
commit 4b5aa3d98c
4 changed files with 11 additions and 3 deletions

View File

@ -5,6 +5,7 @@ import io.metersphere.base.domain.Role;
import io.metersphere.commons.user.SessionUser;
import io.metersphere.commons.utils.SessionUtils;
import io.metersphere.dto.UserDTO;
import io.metersphere.i18n.Translator;
import io.metersphere.service.UserService;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.authc.*;
@ -67,7 +68,7 @@ public class ShiroDBRealm extends AuthorizingRealm {
UserDTO user = userService.getUserDTO(userId);
String msg;
if (user == null) {
msg = "The user does not exist: " + userId;
msg = Translator.get("user_not_exist") + userId;
logger.warn(msg);
throw new UnknownAccountException(msg);
}
@ -79,7 +80,7 @@ public class ShiroDBRealm extends AuthorizingRealm {
}
// 密码验证
if (!userService.checkUserPassword(userId, password)) {
throw new IncorrectCredentialsException("The password is incorrect");
throw new IncorrectCredentialsException(Translator.get("password_is_incorrect"));
}
//
SessionUser sessionUser = SessionUser.fromUser(user);

View File

@ -98,4 +98,6 @@ plan_name_already_exists=Test plan name already exists
test_case_already_exists_excel=There are duplicate test cases in the import file
api_test_name_already_exists=Test name already exists
password_is_incorrect=Incorrect password
user_not_exist=user does not exist
user_not_exist=user does not exist
user_has_been_disabled=the user has been disabled.
excessive_attempts=Excessive attempts

View File

@ -101,4 +101,7 @@ api_test_name_already_exists=测试名称已经存在
login_fail=登陆失败
password_is_incorrect=密码不正确
user_not_exist=用户不存在:
user_has_been_disabled=用户已被禁用
excessive_attempts=操作频繁
user_has_been_locked

View File

@ -99,3 +99,5 @@ test_case_already_exists_excel=導入文件中存在重復用例
api_test_name_already_exists=測試名稱已經存在
password_is_incorrect=密碼不正確
user_not_exist=用戶不存在:
user_has_been_disabled.=用戶已被禁用
excessive_attempts=操作頻繁