From 3357b5f0f0919f7a52cd32a6d6de0acb14e0daaf Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期二, 17 十二月 2024 17:29:01 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 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