fix 权限下挼吗init初始化 没有设置默认值

This commit is contained in:
oldHome 2025-06-27 17:57:05 +08:00
parent 8a3bddb917
commit fb7067007c

View File

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