From 3e359e4550d018035406a97c190b98f83839ba7f Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期五, 13 十二月 2024 10:41:05 +0800 Subject: [PATCH] 1、工作流重做更新 2、@import修改为@use以应对sass升级弃用@import 3、进入系统后自动redirect到home页 --- src/store/modules/permission.ts | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts index 12ddb45..2000b33 100644 --- a/src/store/modules/permission.ts +++ b/src/store/modules/permission.ts @@ -35,15 +35,18 @@ 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', + // redirect: '/404', + component: () => import('@/views/Error/404.vue'), name: '404Page', meta: { hidden: true, -- Gitblit v1.9.3