From 8fa00227ff7ae38dbe04d213faf380e86285d3de Mon Sep 17 00:00:00 2001 From: dong <58670809@qq.com> Date: Wed, 21 Dec 2022 10:35:55 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=AF=E7=94=B1=E6=9D=83=E9=99=90=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 17 ++++++++++++----- src/store/modules/permission.js | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index 407910b4c..d53014273 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -751,6 +751,7 @@ export const asyncRouter = [ meta: { roles: [admin, user] }, + hidden: true, children: [ { path: '', @@ -941,6 +942,7 @@ export const asyncRouter = [ i18n: 'router.pulishManage', roles: [admin] }, + hidden: true, children: [ { // 发布地图 path: 'map', @@ -1041,6 +1043,7 @@ export const asyncRouter = [ i18n: 'router.orderAuthorityManage', roles: [admin] }, + hidden: true, children: [ { path: 'author/manage', @@ -1112,6 +1115,7 @@ export const asyncRouter = [ i18n: 'router.systemManage', roles: [admin] }, + hidden: true, children: [ { path: 'dictionary', @@ -1323,6 +1327,7 @@ export const asyncRouter = [ i18n: 'router.fileManage', roles: [admin] }, + hidden: true, children: [ { path: 'list', @@ -1399,6 +1404,7 @@ export const asyncRouter = [ i18n: 'router.newDesignUserPage', roles: [admin, user] }, + hidden: true, children: [ { path: 'usermap', @@ -1505,6 +1511,7 @@ export const asyncRouter = [ i18n: 'router.raceManage', roles: [admin] }, + hidden: true, children: [ { path: 'bank', @@ -1549,7 +1556,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'newRouter.simulation', - roles: [admin, user, userTrainingPlatform] + roles: [user] }, children: [ { // 仿真 @@ -1589,7 +1596,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'newRouter.teachingManagement', - roles: [admin, user, userTrainingPlatform] + roles: [admin, user] }, children: [ { @@ -1756,7 +1763,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'newRouter.lineDesign', - roles: [admin, user, userTrainingPlatform] + roles: [admin] }, children: [ { @@ -1793,7 +1800,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'newRouter.case', - roles: [admin, user, userTrainingPlatform] + roles: [admin, user] }, children: [ { @@ -1827,7 +1834,7 @@ export const asyncRouter = [ component: Layout, meta: { i18n: 'newRouter.SystemManagement', - roles: [admin, userTrainingPlatform] + roles: [admin] }, children: [ { // 系统数据管理 diff --git a/src/store/modules/permission.js b/src/store/modules/permission.js index 63a76fd8b..bb2ce3979 100644 --- a/src/store/modules/permission.js +++ b/src/store/modules/permission.js @@ -20,7 +20,8 @@ function hasPermission(roles, route, parentsRoles) { return result.length && route.meta.roles.indexOf(userTrainingPlatform) < 0; } else { roles = roles.filter((role) => route.meta.roles.indexOf(role) >= 0); - return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) >= 0; + // return roles.some(role => route.meta.roles.indexOf(role) >= 0) && route.meta.roles.indexOf(userTrainingPlatform) >= 0; + return roles.some(role => route.meta.roles.indexOf(role) >= 0); } } else if (parentsRoles) { // 如果没有本级路由,有父级路由,则使用父级路由过滤