Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
23afff82af
|
@ -2,9 +2,10 @@ package io.metersphere.base.mapper;
|
|||
|
||||
import io.metersphere.base.domain.User;
|
||||
import io.metersphere.base.domain.UserExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface UserMapper {
|
||||
long countByExample(UserExample example);
|
||||
|
||||
|
@ -29,4 +30,7 @@ public interface UserMapper {
|
|||
int updateByPrimaryKey(User record);
|
||||
|
||||
int updatePassword(User record);
|
||||
|
||||
String getDefaultlanguage(String paramKey);
|
||||
|
||||
}
|
|
@ -304,11 +304,15 @@
|
|||
where id = #{id,jdbcType=VARCHAR}
|
||||
</update>
|
||||
<!--修改密码-->
|
||||
<update id="updatePassword" parameterType="io.metersphere.base.domain.User">
|
||||
<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>
|
|
@ -3,10 +3,14 @@ package io.metersphere.base.mapper.ext;
|
|||
import io.metersphere.base.domain.User;
|
||||
import io.metersphere.controller.request.UserRequest;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ExtUserMapper {
|
||||
|
||||
List<User> getUserList(@Param("userRequest") UserRequest request);
|
||||
|
||||
int updatePassword(User record);
|
||||
|
||||
String getDefaultlanguage(String paramKey);
|
||||
}
|
||||
|
|
|
@ -41,5 +41,9 @@
|
|||
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>
|
|
@ -87,4 +87,10 @@ public class LoginController {
|
|||
return ResultHolder.success("");
|
||||
}
|
||||
|
||||
/*Get default language*/
|
||||
@PostMapping(value = "/language")
|
||||
public String getDefaultlanguage() {
|
||||
return userService.getDefaultlanguage();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -344,4 +344,9 @@ public class UserService {
|
|||
userRole.setUpdateTime(System.currentTimeMillis());
|
||||
userRoleMapper.insertSelective(userRole);
|
||||
}
|
||||
|
||||
public String getDefaultlanguage() {
|
||||
final String key = "registry.defaultlanguage";
|
||||
return extUserMapper.getDefaultlanguage(key);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,10 +107,10 @@
|
|||
this.$post("signin", this.form, response => {
|
||||
saveLocalStorage(response);
|
||||
let language = response.data.language;
|
||||
if (!language) {
|
||||
language = 'zh_CN';
|
||||
}
|
||||
this.$setLang(language);
|
||||
this.$post("language",response=>{
|
||||
this.$setLang(language);
|
||||
})
|
||||
|
||||
window.location.href = "/"
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue