fix 权限下挼吗init初始化 没有设置默认值
This commit is contained in:
parent
8a3bddb917
commit
fb7067007c
@ -77,7 +77,7 @@ export default {
|
||||
upFile: '',
|
||||
oldFile: '',
|
||||
pwd: '',
|
||||
role: 'admin'
|
||||
role: ''
|
||||
},
|
||||
adminId: this.$route.params.id, // get参数 获取管理员id 没有为添加页面
|
||||
pageState: 'add', // 页面状态
|
||||
@ -121,6 +121,7 @@ export default {
|
||||
this.form.name = data.name
|
||||
this.form.uname = data.uname
|
||||
this.form.oldFile = data.oldFile
|
||||
this.form.role = data.role
|
||||
if (Object.keys(data).length === 0) {
|
||||
this.$message.warning('清空表单')
|
||||
}
|
||||
@ -136,7 +137,7 @@ export default {
|
||||
const data = {
|
||||
name: this.admin.name,
|
||||
uname: this.admin.uname,
|
||||
role: this.admin.role === 5 ? 'admin' : 'editor',
|
||||
role: (Number(this.admin.role) === 5 || Number(this.admin.role) === 4) ? 'admin' : 'editor',
|
||||
oldFile: this.admin.photo,
|
||||
shop_id: this.admin.shop_id
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user