jpa修改用户死循环、参数

This commit is contained in:
lyd
2022-09-28 17:31:46 +08:00
parent 8ca24695d4
commit 25a336fe72
4 changed files with 26 additions and 11 deletions

View File

@@ -125,16 +125,18 @@ public class UserServiceImpl implements UserService {
if(!resources.getEnabled()){
onlineUserService.kickOutForUsername(resources.getUsername());
}
user.setUsername(resources.getUsername());
user.setEmail(resources.getEmail());
user.setEnabled(resources.getEnabled());
user.setRoles(resources.getRoles());
user.setDept(resources.getDept());
user.setPhone(resources.getPhone());
user.setNickName(resources.getNickName());
user.setGender(resources.getGender());
User clone = new User(); // jpa 多表问题,需要用新的类来进行修改
clone.setId(resources.getId());
clone.setUsername(resources.getUsername());
clone.setEmail(resources.getEmail());
clone.setEnabled(resources.getEnabled());
clone.setRoles(resources.getRoles());
clone.setDept(resources.getDept());
clone.setPhone(resources.getPhone());
clone.setNickName(resources.getNickName());
clone.setGender(resources.getGender());
userRepository.save(user);
userRepository.save(clone);
// 清除缓存
delCaches(user.getId(), user.getUsername());
// 修改session

View File

@@ -76,3 +76,5 @@ security:
- /actuator/**
# 上传
- /api/localStorage/pictures
# 参数
- /api/param/getValueByCode

View File

@@ -35,8 +35,14 @@ export default {
data() {
return {
title: '诺力开发平台',
logo: Logo
logo: Logo,
title_param: 'platform'
}
},
created() {
this.getValueByCode(this.title_param).then(res => {
this.title = res.value
})
}
}
</script>

View File

@@ -2,7 +2,7 @@
<div class="login" :style="'background-image:url('+ Background +');'">
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" label-position="left" label-width="0px" class="login-form">
<h3 class="title">
诺力开发平台</h3>
{{title}}</h3>
<el-form-item prop="username">
<el-input v-model="loginForm.username" type="text" auto-complete="off" placeholder="账号">
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
@@ -50,6 +50,8 @@ export default {
name: 'Login',
data() {
return {
title: '诺力开发平台',
title_param: 'platform',
Background: Background,
codeUrl: '',
cookiePass: '',
@@ -78,6 +80,9 @@ export default {
}
},
created() {
this.getValueByCode(this.title_param).then(res => {
this.title = res.value
})
// 获取验证码
this.getCode()
// 获取用户名密码等Cookie