diff --git a/backend/src/main/java/io/metersphere/security/ShiroDBRealm.java b/backend/src/main/java/io/metersphere/security/ShiroDBRealm.java index 19bc66bd0f..03b0a7faeb 100644 --- a/backend/src/main/java/io/metersphere/security/ShiroDBRealm.java +++ b/backend/src/main/java/io/metersphere/security/ShiroDBRealm.java @@ -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); diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index a5f65cae3d..23b199455e 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -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: \ No newline at end of file +user_not_exist=user does not exist: +user_has_been_disabled=the user has been disabled. +excessive_attempts=Excessive attempts \ No newline at end of file diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index 60b4bc0b7a..a899cf8073 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -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 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 77eec9220b..32d3150c1f 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -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=操作頻繁