From 23c8b8154fcf7c9251d07f028f3e14737ba4cecd Mon Sep 17 00:00:00 2001 From: dongyukun <1208714201@qq.com> Date: 星期二, 31 十二月 2024 19:04:35 +0800 Subject: [PATCH] 调度模型下发配置 --- src/store/modules/permission.ts | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 12ddb45..f32facc 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -35,15 +35,17 @@ return new Promise<void>(async (resolve) => { // 获得菜单列表,它在登录的时候,setUserInfoAction 方法中已经进行获取 let res: AppCustomRouteRecordRaw[] = [] - if (wsSessionCache.get(CACHE_KEY.ROLE_ROUTERS)) { - res = wsSessionCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[] + const roleRouters = wsSessionCache.get(CACHE_KEY.ROLE_ROUTERS) + if (roleRouters) { + res = roleRouters as AppCustomRouteRecordRaw[] } const routerMap: AppRouteRecordRaw[] = generateRoute(res) // 动态路由,404一定要放到最后面 + // preschooler:vue-router@4以后已支持静态404路由,此处可不再追加 this.addRouters = routerMap.concat([ { path: '/:path(.*)*', - redirect: '/404', + component: () => import('@/views/Error/404.vue'), name: '404Page', meta: { hidden: true, -- Gitblit v1.9.3