用户管理代码更新
This commit is contained in:
@@ -77,12 +77,9 @@ public class User extends BaseEntity implements Serializable {
|
|||||||
@ApiModelProperty(value = "用户昵称")
|
@ApiModelProperty(value = "用户昵称")
|
||||||
private String nickName;
|
private String nickName;
|
||||||
|
|
||||||
@Email
|
|
||||||
@NotBlank
|
|
||||||
@ApiModelProperty(value = "邮箱")
|
@ApiModelProperty(value = "邮箱")
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
@NotBlank
|
|
||||||
@ApiModelProperty(value = "电话号码")
|
@ApiModelProperty(value = "电话号码")
|
||||||
private String phone;
|
private String phone;
|
||||||
|
|
||||||
|
|||||||
@@ -119,6 +119,7 @@ public class UserServiceImpl implements UserService {
|
|||||||
redisUtils.del(CacheKey.MENU_USER + resources.getId());
|
redisUtils.del(CacheKey.MENU_USER + resources.getId());
|
||||||
redisUtils.del(CacheKey.ROLE_AUTH + resources.getId());
|
redisUtils.del(CacheKey.ROLE_AUTH + resources.getId());
|
||||||
}
|
}
|
||||||
|
redisUtils.del("user::username:" + user.getUsername());
|
||||||
// 如果用户名称修改
|
// 如果用户名称修改
|
||||||
if(!resources.getUsername().equals(user.getUsername())){
|
if(!resources.getUsername().equals(user.getUsername())){
|
||||||
redisUtils.del("user::username:" + user.getUsername());
|
redisUtils.del("user::username:" + user.getUsername());
|
||||||
|
|||||||
@@ -173,7 +173,7 @@
|
|||||||
<el-table-column show-overflow-tooltip width="135" prop="email" label="邮箱" />
|
<el-table-column show-overflow-tooltip width="135" prop="email" label="邮箱" />
|
||||||
<el-table-column show-overflow-tooltip prop="dept" label="部门">
|
<el-table-column show-overflow-tooltip prop="dept" label="部门">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div>{{ scope.row.dept.name }}</div>
|
<div>{{ scope.row.dept?scope.row.dept.name:'-' }}</div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="状态" align="center" prop="enabled">
|
<el-table-column label="状态" align="center" prop="enabled">
|
||||||
@@ -291,13 +291,6 @@ export default {
|
|||||||
{ required: true, message: '请输入用户昵称', trigger: 'blur' },
|
{ required: true, message: '请输入用户昵称', trigger: 'blur' },
|
||||||
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
{ min: 2, max: 20, message: '长度在 2 到 20 个字符', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
email: [
|
|
||||||
{ required: true, message: '请输入邮箱地址', trigger: 'blur' },
|
|
||||||
{ type: 'email', message: '请输入正确的邮箱地址', trigger: 'blur' }
|
|
||||||
],
|
|
||||||
phone: [
|
|
||||||
{ required: true, trigger: 'blur', validator: validPhone }
|
|
||||||
],
|
|
||||||
password: [
|
password: [
|
||||||
{ max: 20, message: '长度最多 20 个字符', trigger: 'change' }
|
{ max: 20, message: '长度最多 20 个字符', trigger: 'change' }
|
||||||
]
|
]
|
||||||
@@ -357,9 +350,6 @@ export default {
|
|||||||
this.jobDatas = []
|
this.jobDatas = []
|
||||||
this.roleDatas = []
|
this.roleDatas = []
|
||||||
},
|
},
|
||||||
[CRUD.HOOK.afterRefresh]() {
|
|
||||||
console.log(this.crud.data)
|
|
||||||
},
|
|
||||||
// 初始化编辑时候的角色与岗位
|
// 初始化编辑时候的角色与岗位
|
||||||
[CRUD.HOOK.beforeToEdit](crud, form) {
|
[CRUD.HOOK.beforeToEdit](crud, form) {
|
||||||
this.getJobs(this.form.dept.id)
|
this.getJobs(this.form.dept.id)
|
||||||
@@ -387,12 +377,6 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
} else if (this.jobDatas.length === 0) {
|
|
||||||
this.$message({
|
|
||||||
message: '岗位不能为空',
|
|
||||||
type: 'warning'
|
|
||||||
})
|
|
||||||
return false
|
|
||||||
} else if (this.roleDatas.length === 0) {
|
} else if (this.roleDatas.length === 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '角色不能为空',
|
message: '角色不能为空',
|
||||||
|
|||||||
Reference in New Issue
Block a user