From f5568205f9ebe7c018a17abb99eaa939178864c0 Mon Sep 17 00:00:00 2001 From: xianfuxing Date: Mon, 8 Oct 2018 19:22:55 +0800 Subject: [PATCH] =?UTF-8?q?#=20=E8=B0=83=E6=95=B4=E6=9D=83=E9=99=90?= =?UTF-8?q?=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 2 +- src/views/dashboard/index.vue | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) 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)