From f59ae61a06c5ca9421cac0b1f030586cab0e6cf8 Mon Sep 17 00:00:00 2001 From: wenyann <64353056+wenyann@users.noreply.github.com> Date: Thu, 14 May 2020 16:32:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E9=BB=98=E8=AE=A4=E8=AF=AD?= =?UTF-8?q?=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/base/mapper/UserMapper.java | 2 -- .../java/io/metersphere/base/mapper/UserMapper.xml | 13 +------------ .../metersphere/base/mapper/ext/ExtUserMapper.java | 2 +- .../metersphere/base/mapper/ext/ExtUserMapper.xml | 2 +- .../io/metersphere/controller/LoginController.java | 4 ++-- .../java/io/metersphere/service/UserService.java | 4 ++-- frontend/src/login/Login.vue | 10 +++++++--- 7 files changed, 14 insertions(+), 23 deletions(-) diff --git a/backend/src/main/java/io/metersphere/base/mapper/UserMapper.java b/backend/src/main/java/io/metersphere/base/mapper/UserMapper.java index 8e738d0d77..69d4f62258 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/UserMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/UserMapper.java @@ -29,8 +29,6 @@ public interface UserMapper { int updateByPrimaryKey(User record); - int updatePassword(User record); - String getDefaultlanguage(String paramKey); } \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/UserMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/UserMapper.xml index 43dfaa05ef..2e9797c759 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/UserMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/UserMapper.xml @@ -303,16 +303,5 @@ phone = #{phone,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} - - - update user - set - password=#{password,jdbcType=VARCHAR}, - update_time = #{updateTime,jdbcType=BIGINT} - where id=#{id,jdbcType=VARCHAR} - - + \ No newline at end of file diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java index 202d02d059..b3e7f4a225 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.java @@ -12,5 +12,5 @@ public interface ExtUserMapper { int updatePassword(User record); - String getDefaultlanguage(String paramKey); + String getDefaultLanguage(String paramKey); } diff --git a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml index 161c862d72..bb4c14a790 100644 --- a/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml +++ b/backend/src/main/java/io/metersphere/base/mapper/ext/ExtUserMapper.xml @@ -41,7 +41,7 @@ update_time = #{updateTime,jdbcType=BIGINT} where id=#{id,jdbcType=VARCHAR} - select param_value from system_parameter where param_key=#{paramKey,jdbcType=VARCHAR} diff --git a/backend/src/main/java/io/metersphere/controller/LoginController.java b/backend/src/main/java/io/metersphere/controller/LoginController.java index ca80e0503e..4e46ee8701 100644 --- a/backend/src/main/java/io/metersphere/controller/LoginController.java +++ b/backend/src/main/java/io/metersphere/controller/LoginController.java @@ -89,8 +89,8 @@ public class LoginController { /*Get default language*/ @PostMapping(value = "/language") - public String getDefaultlanguage() { - return userService.getDefaultlanguage(); + public String getDefaultLanguage() { + return userService.getDefaultLanguage(); } } diff --git a/backend/src/main/java/io/metersphere/service/UserService.java b/backend/src/main/java/io/metersphere/service/UserService.java index cceeee7973..7bbf15c563 100644 --- a/backend/src/main/java/io/metersphere/service/UserService.java +++ b/backend/src/main/java/io/metersphere/service/UserService.java @@ -345,8 +345,8 @@ public class UserService { userRoleMapper.insertSelective(userRole); } - public String getDefaultlanguage() { + public String getDefaultLanguage() { final String key = "registry.defaultlanguage"; - return extUserMapper.getDefaultlanguage(key); + return extUserMapper.getDefaultLanguage(key); } } diff --git a/frontend/src/login/Login.vue b/frontend/src/login/Login.vue index c9d995de38..be61cfa360 100644 --- a/frontend/src/login/Login.vue +++ b/frontend/src/login/Login.vue @@ -107,9 +107,13 @@ this.$post("signin", this.form, response => { saveLocalStorage(response); let language = response.data.language; - this.$post("language",response=>{ - this.$setLang(language); - }) + if (!language) { + this.$post("language", response => { + language = response.data.language + this.$setLang(language); + }) + } + window.location.href = "/" });