This commit is contained in:
chenjianxing 2020-05-14 16:46:10 +08:00
commit bd0365135e
7 changed files with 14 additions and 23 deletions

View File

@ -29,8 +29,6 @@ public interface UserMapper {
int updateByPrimaryKey(User record);
int updatePassword(User record);
String getDefaultlanguage(String paramKey);
}

View File

@ -303,16 +303,5 @@
phone = #{phone,jdbcType=VARCHAR}
where id = #{id,jdbcType=VARCHAR}
</update>
<!--修改密码-->
<update id="updatePassword" parameterType="io.metersphere.base.domain.User">
update user
set
password=#{password,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=BIGINT}
where id=#{id,jdbcType=VARCHAR}
</update>
<select id="getDefaultlanguage" parameterType="java.lang.String" resultType="java.lang.String">
select param_value from system_parameter
where param_key=#{paramKey,jdbcType=VARCHAR}
</select>
</mapper>

View File

@ -12,5 +12,5 @@ public interface ExtUserMapper {
int updatePassword(User record);
String getDefaultlanguage(String paramKey);
String getDefaultLanguage(String paramKey);
}

View File

@ -41,7 +41,7 @@
update_time = #{updateTime,jdbcType=BIGINT}
where id=#{id,jdbcType=VARCHAR}
</update>
<select id="getDefaultlanguage" parameterType="java.lang.String" resultType="java.lang.String">
<select id="getDefaultLanguage" parameterType="java.lang.String" resultType="java.lang.String">
select param_value from system_parameter
where param_key=#{paramKey,jdbcType=VARCHAR}
</select>

View File

@ -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();
}
}

View File

@ -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);
}
}

View File

@ -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 = "/"
});