# 调整权限名称

This commit is contained in:
xianfuxing 2018-10-08 19:22:55 +08:00
parent 5b2f7d7c9d
commit f5568205f9
2 changed files with 2 additions and 3 deletions

View File

@ -120,6 +120,7 @@ export const asyncRouterMap = [
{
path: '/settings/device',
component: Layout,
meta: { roles: ['superadmin', 'admin'] },
children: [{
path: 'index',
component: () => import('@/views/settings/device'),
@ -131,7 +132,6 @@ export const asyncRouterMap = [
{
path: '/settings/system',
component: Layout,
meta: { roles: ['admin'] },
children: [{
path: 'index',
component: () => import('@/views/settings/system'),

View File

@ -14,7 +14,6 @@ export default {
components: { adminDashboard, editorDashboard },
data() {
return {
allowRoles: ['admin', 'customer'],
currentRole: 'adminDashboard'
}
},
@ -24,7 +23,7 @@ export default {
])
},
created() {
const adminDashboardRoles = new Set(['admin', 'customer'])
const adminDashboardRoles = new Set(['superadmin', 'admin', 'staff'])
const userRoles = new Set(this.roles)
const intersection = new Set([...userRoles].filter(role => adminDashboardRoles.has(role)))
console.log(intersection.size)