From b06215f5821ae7c9679aef158b342e1b6ff7ac57 Mon Sep 17 00:00:00 2001 From: q4speed Date: Wed, 3 Jun 2020 18:07:28 +0800 Subject: [PATCH 01/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AD=97=E7=AC=A6?= =?UTF-8?q?=E9=9B=86bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/api/jmeter/APIBackendListenerClient.java | 2 +- backend/src/main/resources/jmeter/bin/jmeter.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index ee3867c40c..ec7ac7f713 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -126,7 +126,7 @@ public class APIBackendListenerClient extends AbstractBackendListenerClient impl } ResponseResult responseResult = requestResult.getResponseResult(); - responseResult.setBody(new String(result.getResponseData(), StandardCharsets.UTF_8)); + responseResult.setBody(result.getResponseDataAsString()); responseResult.setHeaders(result.getResponseHeaders()); responseResult.setLatency(result.getLatency()); responseResult.setResponseCode(result.getResponseCode()); diff --git a/backend/src/main/resources/jmeter/bin/jmeter.properties b/backend/src/main/resources/jmeter/bin/jmeter.properties index a002245bd1..ba00ca8276 100644 --- a/backend/src/main/resources/jmeter/bin/jmeter.properties +++ b/backend/src/main/resources/jmeter/bin/jmeter.properties @@ -1081,7 +1081,7 @@ csvdataset.file.encoding_list=UTF-8|UTF-16|ISO-8859-15|US-ASCII #httpsampler.user_defined_methods=VERSION-CONTROL,REPORT,CHECKOUT,CHECKIN,UNCHECKOUT,MKWORKSPACE,UPDATE,LABEL,MERGE,BASELINE-CONTROL,MKACTIVITY # The encoding to be used if none is provided (default ISO-8859-1) -#sampleresult.default.encoding=ISO-8859-1 +sampleresult.default.encoding=UTF-8 # CookieManager behaviour - should cookies with null/empty values be deleted? # Default is true. Use false to revert to original behaviour From f83e2a69cc6d540e7c8a913b2f7db3a799d59029 Mon Sep 17 00:00:00 2001 From: q4speed Date: Wed, 3 Jun 2020 18:15:21 +0800 Subject: [PATCH 02/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/business/components/api/test/ApiTestList.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/api/test/ApiTestList.vue b/frontend/src/business/components/api/test/ApiTestList.vue index 30f157b31a..b232428c18 100644 --- a/frontend/src/business/components/api/test/ApiTestList.vue +++ b/frontend/src/business/components/api/test/ApiTestList.vue @@ -139,7 +139,7 @@ }, handleCopy(test) { this.result = this.$post("/api/copy", {id: test.id}, () => { - this.$success(this.$t('commons.delete_success')); + this.$success(this.$t('commons.copy_success')); this.search(); }); }, From 22fb6855abe06967712fabaacfb6c32d3dbe1ab5 Mon Sep 17 00:00:00 2001 From: q4speed Date: Wed, 3 Jun 2020 18:16:38 +0800 Subject: [PATCH 03/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E6=88=90=E5=8A=9F=E6=8F=90=E7=A4=BAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/performance/test/PerformanceTestPlan.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/performance/test/PerformanceTestPlan.vue b/frontend/src/business/components/performance/test/PerformanceTestPlan.vue index 47c65d24d4..9e4419a759 100644 --- a/frontend/src/business/components/performance/test/PerformanceTestPlan.vue +++ b/frontend/src/business/components/performance/test/PerformanceTestPlan.vue @@ -174,7 +174,7 @@ }, handleCopy(testPlan) { this.result = this.$post("/performance/copy", {id: testPlan.id}, () => { - this.$success(this.$t('commons.save_success')); + this.$success(this.$t('commons.copy_success')); this.search(); }); }, From 19b400b1c6bbe2c9f687e3670321ba10923c9ec5 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 4 Jun 2020 10:48:05 +0800 Subject: [PATCH 04/15] =?UTF-8?q?'=E4=BF=AE=E5=A4=8D=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA=E4=B8=8D=E5=85=A8'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/settings/personal/PersonSetting.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/business/components/settings/personal/PersonSetting.vue b/frontend/src/business/components/settings/personal/PersonSetting.vue index ef6911d872..222e0d6a51 100644 --- a/frontend/src/business/components/settings/personal/PersonSetting.vue +++ b/frontend/src/business/components/settings/personal/PersonSetting.vue @@ -59,7 +59,7 @@ - + From ee306e720e98336038bfb576417517e92bf5757a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8C=AF?= Date: Thu, 4 Jun 2020 10:49:31 +0800 Subject: [PATCH 05/15] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9E=84=E5=BB=BA?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Dockerfile b/Dockerfile index 2b95f96957..a23c694018 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,6 +2,8 @@ FROM registry.fit2cloud.com/metersphere/fabric8-java-alpine-openjdk8-jre MAINTAINER FIT2CLOUD +ARG MS_VERSION + RUN mkdir -p /opt/apps && mkdir -p /opt/jmeter ADD backend/target/backend-1.0.jar /opt/apps @@ -12,5 +14,7 @@ ENV JAVA_APP_JAR=/opt/apps/backend-1.0.jar ENV AB_OFF=true +ENV MS_VERSION=${MS_VERSION} + ENV JAVA_OPTIONS="-Dfile.encoding=utf-8 -Djava.awt.headless=true" CMD ["/deployments/run-java.sh"] From 07a53aa6f30def50aebfbaf789170eb337f2ccae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E6=8C=AF?= Date: Thu, 4 Jun 2020 10:50:29 +0800 Subject: [PATCH 06/15] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a23c694018..16209e91ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,7 +2,7 @@ FROM registry.fit2cloud.com/metersphere/fabric8-java-alpine-openjdk8-jre MAINTAINER FIT2CLOUD -ARG MS_VERSION +ARG MS_VERSION=dev RUN mkdir -p /opt/apps && mkdir -p /opt/jmeter From 4191176da791db82c2b28eb3c813b2b09f9f6bd6 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 4 Jun 2020 11:03:15 +0800 Subject: [PATCH 07/15] =?UTF-8?q?'=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E5=AF=86=E7=A0=81=E6=8F=90=E7=A4=BA'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/i18n/messages_en_US.properties | 2 +- backend/src/main/resources/i18n/messages_zh_CN.properties | 2 +- backend/src/main/resources/i18n/messages_zh_TW.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 86437e2cd0..d8e9c3d8fb 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -12,7 +12,7 @@ user_name_is_null=User name cannot be null user_email_is_null=User email cannot be null password_is_null=Password cannot be null user_id_already_exists=User ID already exists -password_modification_failed=Password modification failed +password_modification_failed=The old password is wrong. Please re-enter it cannot_delete_current_user=Cannot delete the user currently logged in user_already_exists=The user already exists in the current member list #load test diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index ffe808cb7d..fd8016c757 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -11,7 +11,7 @@ user_name_is_null=用户名不能为空 user_email_is_null=用户邮箱不能为空 password_is_null=密码不能为空 user_id_already_exists=用户id已存在 -password_modification_failed=密码修改失败 +password_modification_failed=旧密码输入错误,请重新输入 cannot_delete_current_user=无法删除当前登录用户 connection_failed=连接失败 user_already_exists=该用户已存在于当前成员列表中 diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 842c0a6016..4138287cd6 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -12,7 +12,7 @@ user_name_is_null=用戶名不能為空 user_email_is_null=用戶郵箱不能為空 password_is_null=密碼不能為空 user_id_already_exists=用戶id已存在 -password_modification_failed=密碼修改失敗 +password_modification_failed=舊密碼輸入錯誤,請重新輸入 cannot_delete_current_user=無法刪除當前登錄用戶 user_already_exists=該用戶已存在於當前成員列表中 #load test From 381189cb39120c5c24f64e7c7250604c74e12c82 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 4 Jun 2020 11:58:08 +0800 Subject: [PATCH 08/15] =?UTF-8?q?'=E7=99=BB=E9=99=86=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/src/main/resources/i18n/messages_en_US.properties | 4 +++- backend/src/main/resources/i18n/messages_zh_CN.properties | 5 +++++ backend/src/main/resources/i18n/messages_zh_TW.properties | 4 +++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index d8e9c3d8fb..a5f65cae3d 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -96,4 +96,6 @@ please_input_workspace_member=Please input workspace merber test_case_report_template_repeat=The workspace has the same name template 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 \ No newline at end of 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 diff --git a/backend/src/main/resources/i18n/messages_zh_CN.properties b/backend/src/main/resources/i18n/messages_zh_CN.properties index fd8016c757..60b4bc0b7a 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -15,6 +15,7 @@ password_modification_failed=旧密码输入错误,请重新输入 cannot_delete_current_user=无法删除当前登录用户 connection_failed=连接失败 user_already_exists=该用户已存在于当前成员列表中 + #load test edit_load_test_not_found=无法编辑测试,未找到测试: run_load_test_not_found=无法运行测试,未找到测试: @@ -97,3 +98,7 @@ test_case_report_template_repeat=同一工作空间下不能存在同名模版 plan_name_already_exists=测试计划名称已存在 test_case_already_exists_excel=导入文件中存在重复用例 api_test_name_already_exists=测试名称已经存在 +login_fail=登陆失败 +password_is_incorrect=密码不正确 +user_not_exist=用户不存在: + diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 4138287cd6..77eec9220b 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -96,4 +96,6 @@ please_input_workspace_member=請填寫該工作空間相關人員 test_case_report_template_repeat=同壹工作空間下不能存在同名模版 plan_name_already_exists=測試計劃名稱已存在 test_case_already_exists_excel=導入文件中存在重復用例 -api_test_name_already_exists=測試名稱已經存在 \ No newline at end of file +api_test_name_already_exists=測試名稱已經存在 +password_is_incorrect=密碼不正確 +user_not_exist=用戶不存在: From 3cdd916633558d62bd656d7cdd6c6d61032e4ebc Mon Sep 17 00:00:00 2001 From: q4speed Date: Thu, 4 Jun 2020 14:17:05 +0800 Subject: [PATCH 09/15] =?UTF-8?q?=E5=8E=BB=E6=8E=89=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/api/jmeter/APIBackendListenerClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java index ec7ac7f713..72c3e24b39 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/APIBackendListenerClient.java @@ -12,7 +12,6 @@ import org.apache.jmeter.visualizers.backend.AbstractBackendListenerClient; import org.apache.jmeter.visualizers.backend.BackendListenerContext; import java.io.Serializable; -import java.nio.charset.StandardCharsets; import java.util.*; /** From dcdda0b3b82f897ffd579d2f8ca8c13c6ba0d221 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 4 Jun 2020 14:25:43 +0800 Subject: [PATCH 10/15] =?UTF-8?q?fix=20=E5=88=9B=E5=BB=BA=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=97=B6=E5=AF=86=E7=A0=81=E8=87=AA=E5=8A=A8=E5=A1=AB?= =?UTF-8?q?=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/business/components/settings/system/User.vue | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index ea5e70ced2..1f10e9e7e5 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -53,19 +53,19 @@ :destroy-on-close="true"> - + - + - + - + - +
Date: Thu, 4 Jun 2020 14:32:43 +0800 Subject: [PATCH 11/15] i18n --- .../src/business/components/settings/system/User.vue | 10 +++++----- frontend/src/i18n/en-US.js | 1 + frontend/src/i18n/zh-CN.js | 1 + frontend/src/i18n/zh-TW.js | 1 + 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/frontend/src/business/components/settings/system/User.vue b/frontend/src/business/components/settings/system/User.vue index 1f10e9e7e5..44080272a7 100644 --- a/frontend/src/business/components/settings/system/User.vue +++ b/frontend/src/business/components/settings/system/User.vue @@ -53,19 +53,19 @@ :destroy-on-close="true"> - + - + - + - + - +
Date: Thu, 4 Jun 2020 14:43:27 +0800 Subject: [PATCH 12/15] =?UTF-8?q?'=E7=99=BB=E9=99=86=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E4=BF=AE=E6=94=B9'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/io/metersphere/security/ShiroDBRealm.java | 5 +++-- backend/src/main/resources/i18n/messages_en_US.properties | 4 +++- backend/src/main/resources/i18n/messages_zh_CN.properties | 3 +++ backend/src/main/resources/i18n/messages_zh_TW.properties | 2 ++ 4 files changed, 11 insertions(+), 3 deletions(-) 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=操作頻繁 From 29417d246ab6e2814c4b4728178a1e9984beedc9 Mon Sep 17 00:00:00 2001 From: q4speed Date: Thu, 4 Jun 2020 15:13:42 +0800 Subject: [PATCH 13/15] =?UTF-8?q?=E4=BF=AE=E5=A4=8Denable=E5=80=BC?= =?UTF-8?q?=E4=B8=BAreadOnly=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../performance/test/components/PerformanceAdvancedConfig.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue b/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue index 655817ea13..130bd914d2 100644 --- a/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue +++ b/frontend/src/business/components/performance/test/components/PerformanceAdvancedConfig.vue @@ -41,7 +41,6 @@ v-model="row.enable" active-color="#13ce66" inactive-color="#ff4949" - active-value="readOnly" @click="confirmEdit(row)" > From 22ff5f0b4b8983160ecef28437c41b82b133996e Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 4 Jun 2020 15:19:10 +0800 Subject: [PATCH 14/15] 'i18n' --- .../metersphere/controller/LoginController.java | 16 ++++++++-------- .../resources/i18n/messages_en_US.properties | 6 +++++- .../resources/i18n/messages_zh_CN.properties | 6 +++++- .../resources/i18n/messages_zh_TW.properties | 4 ++++ 4 files changed, 22 insertions(+), 10 deletions(-) diff --git a/backend/src/main/java/io/metersphere/controller/LoginController.java b/backend/src/main/java/io/metersphere/controller/LoginController.java index 92d3cbfc9e..6b01b6cfdb 100644 --- a/backend/src/main/java/io/metersphere/controller/LoginController.java +++ b/backend/src/main/java/io/metersphere/controller/LoginController.java @@ -1,9 +1,9 @@ package io.metersphere.controller; import io.metersphere.base.domain.UserRole; -import io.metersphere.commons.utils.SessionUtils; import io.metersphere.controller.request.LoginRequest; 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.SecurityUtils; @@ -64,22 +64,22 @@ public class LoginController { // 返回 userDTO return ResultHolder.success(subject.getSession().getAttribute("user")); } else { - return ResultHolder.error("login fail"); + return ResultHolder.error(Translator.get("login_fail")); } } catch (ExcessiveAttemptsException e) { - msg = "excessive attempts"; + msg = "excessive_attempts"; } catch (LockedAccountException e) { - msg = "the user has been locked."; + msg = "user_locked"; } catch (DisabledAccountException e) { - msg = "the user has been disabled. "; + msg = "user_has_been_disabled "; } catch (ExpiredCredentialsException e) { - msg = "user expires. "; + msg = "user_expires. "; } catch (AuthenticationException e) { msg = e.getMessage(); } catch (UnauthorizedException e) { - msg = "not authorized. " + e.getMessage(); + msg = "not_authorized" + e.getMessage(); } - return ResultHolder.error(msg); + return ResultHolder.error(Translator.get(msg)); } @GetMapping(value = "/signout") diff --git a/backend/src/main/resources/i18n/messages_en_US.properties b/backend/src/main/resources/i18n/messages_en_US.properties index 23b199455e..c021488f57 100644 --- a/backend/src/main/resources/i18n/messages_en_US.properties +++ b/backend/src/main/resources/i18n/messages_en_US.properties @@ -100,4 +100,8 @@ api_test_name_already_exists=Test name already exists password_is_incorrect=Incorrect password 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 +excessive_attempts=Excessive attempts +user_locked=the user has been locked. +user_expires=user expires. +not_authorized=not authorized. +login_fail=Login fail \ 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 a899cf8073..5c82e94f38 100644 --- a/backend/src/main/resources/i18n/messages_zh_CN.properties +++ b/backend/src/main/resources/i18n/messages_zh_CN.properties @@ -103,5 +103,9 @@ password_is_incorrect=密码不正确 user_not_exist=用户不存在: user_has_been_disabled=用户已被禁用 excessive_attempts=操作频繁 -user_has_been_locked +user_locked=用户被锁定 +user_expires=用户过期 +not_authorized=未经授权 + + diff --git a/backend/src/main/resources/i18n/messages_zh_TW.properties b/backend/src/main/resources/i18n/messages_zh_TW.properties index 32d3150c1f..57cbfb51e2 100644 --- a/backend/src/main/resources/i18n/messages_zh_TW.properties +++ b/backend/src/main/resources/i18n/messages_zh_TW.properties @@ -101,3 +101,7 @@ password_is_incorrect=密碼不正確 user_not_exist=用戶不存在: user_has_been_disabled.=用戶已被禁用 excessive_attempts=操作頻繁 +user_locked=用戶被鎖定 +user_expires=用戶過期 +not_authorized=未經授權。 +login_fail=登入失敗 From 03787d12c8b2d92f56a6016dbfda42d06d9d49ea Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 4 Jun 2020 15:27:14 +0800 Subject: [PATCH 15/15] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E5=91=98?= =?UTF-8?q?=E6=97=B6=E8=A7=92=E8=89=B2=E9=A1=B9=E4=B8=BA=E5=BF=85=E5=A1=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../organization/OrganizationMember.vue | 18 +++++++++++------- .../organization/OrganizationWorkspace.vue | 18 +++++++++++------- .../settings/system/Organization.vue | 16 ++++++++++------ .../settings/system/SystemWorkspace.vue | 16 ++++++++++------ .../settings/workspace/WorkspaceMember.vue | 16 ++++++++++------ 5 files changed, 52 insertions(+), 32 deletions(-) diff --git a/frontend/src/business/components/settings/organization/OrganizationMember.vue b/frontend/src/business/components/settings/organization/OrganizationMember.vue index 90477b4f43..e2578064d7 100644 --- a/frontend/src/business/components/settings/organization/OrganizationMember.vue +++ b/frontend/src/business/components/settings/organization/OrganizationMember.vue @@ -78,7 +78,7 @@ - + { - this.$success(this.$t('commons.modify_success')); - this.updateVisible = false; - this.initTableData(); - }); + this.$refs[formName].validate((valid) => { + if (valid) { + this.result = this.$post("/organization/member/update", param, () => { + this.$success(this.$t('commons.modify_success')); + this.updateVisible = false; + this.initTableData(); + }); + } + }) }, del(row) { this.$confirm(this.$t('member.remove_member'), '', { diff --git a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue index db46c97168..fab60134bc 100644 --- a/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue +++ b/frontend/src/business/components/settings/organization/OrganizationWorkspace.vue @@ -125,7 +125,7 @@ - + { - this.$success(this.$t('commons.modify_success')); - this.dialogWsMemberUpdateVisible = false; - this.cellClick(this.currentWorkspaceRow); - }); + this.$refs[formName].validate((valid) => { + if (valid) { + this.result = this.$post("/workspace/member/update", param, () => { + this.$success(this.$t('commons.modify_success')); + this.dialogWsMemberUpdateVisible = false; + this.cellClick(this.currentWorkspaceRow); + }); + } + }) }, buildPagePath(path) { return path + "/" + this.dialogCurrentPage + "/" + this.dialogPageSize; diff --git a/frontend/src/business/components/settings/system/Organization.vue b/frontend/src/business/components/settings/system/Organization.vue index c64a579a1e..9e9a8dbd83 100644 --- a/frontend/src/business/components/settings/system/Organization.vue +++ b/frontend/src/business/components/settings/system/Organization.vue @@ -145,7 +145,7 @@ - + { - this.$success(this.$t('commons.modify_success')); - this.dialogOrgMemberUpdateVisible = false; - this.cellClick(this.currentRow); + this.$refs[formName].validate((valid) => { + if (valid) { + this.result = this.$post("/organization/member/update", param, () => { + this.$success(this.$t('commons.modify_success')); + this.dialogOrgMemberUpdateVisible = false; + this.cellClick(this.currentRow); + }); + } }); }, } diff --git a/frontend/src/business/components/settings/system/SystemWorkspace.vue b/frontend/src/business/components/settings/system/SystemWorkspace.vue index dfb8091e9f..8c8c6a4fbf 100644 --- a/frontend/src/business/components/settings/system/SystemWorkspace.vue +++ b/frontend/src/business/components/settings/system/SystemWorkspace.vue @@ -164,7 +164,7 @@ - + { - this.$success(this.$t('commons.modify_success')); - this.dialogWsMemberUpdateVisible = false; - this.cellClick(this.currentWorkspaceRow); + this.$refs[formName].validate((valid) => { + if (valid) { + this.result = this.$post("/workspace/member/update", param, () => { + this.$success(this.$t('commons.modify_success')); + this.dialogWsMemberUpdateVisible = false; + this.cellClick(this.currentWorkspaceRow); + }); + } }); }, }, diff --git a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue index e332d6becb..f767a6361e 100644 --- a/frontend/src/business/components/settings/workspace/WorkspaceMember.vue +++ b/frontend/src/business/components/settings/workspace/WorkspaceMember.vue @@ -79,7 +79,7 @@ - + { - this.$success(this.$t('commons.modify_success')); - this.updateVisible = false; - this.initTableData(); + this.$refs[formName].validate((valid) => { + if (valid) { + this.result = this.$post("/workspace/member/update", param, () => { + this.$success(this.$t('commons.modify_success')); + this.updateVisible = false; + this.initTableData(); + }); + } }); }, create() {