diff --git a/src/router/index.js b/src/router/index.js index e488af7..24a2223 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -336,7 +336,7 @@ const routes = [ meta: { title: '单位管理', icon: 'iconfont icon-a-shanghu_choose2x1', - roles: ['master', 'admin'], + roles: ['master', 'admin', 'editor'], tapName: 'admin' }, children: [ @@ -346,7 +346,7 @@ const routes = [ meta: { title: '单位设置', icon: 'iconfont icon-dianpuguanli', - roles: ['master', 'admin'], + roles: ['master', 'admin', 'editor'], tapName: 'admin' } }, @@ -400,7 +400,7 @@ const routes = [ meta: { title: '账户编辑', icon: 'iconfont icon-huizhi', - roles: ['master', 'admin'], + roles: ['master', 'admin', 'editor'], tapName: 'admin', hidden: true } diff --git a/src/views/layout/components/main/admin/add.vue b/src/views/layout/components/main/admin/add.vue index 0768d9c..44f7c28 100644 --- a/src/views/layout/components/main/admin/add.vue +++ b/src/views/layout/components/main/admin/add.vue @@ -34,7 +34,7 @@ - + 管理员 编辑 @@ -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 }