diff --git a/src/router/index.js b/src/router/index.js index c71981c..5abd644 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -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'), diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 6d1b242..b4d68c4 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -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)