From 2717813966ced88c6a1635663dd01b502158a1b8 Mon Sep 17 00:00:00 2001
From: houzhongjian <houzhongyi@126.com>
Date: 星期四, 05 十二月 2024 17:01:36 +0800
Subject: [PATCH] 1、路由信息存储与session 2、修改与脚手架的跳转对接方式

---
 src/store/modules/permission.ts |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/store/modules/permission.ts b/src/store/modules/permission.ts
index 5e3287a..12ddb45 100644
--- a/src/store/modules/permission.ts
+++ b/src/store/modules/permission.ts
@@ -3,9 +3,9 @@
 import { cloneDeep } from 'lodash-es'
 import remainingRouter from '@/router/modules/remaining'
 import { flatMultiLevelRoutes, generateRoute } from '@/utils/routerHelper'
-import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
+import {CACHE_KEY, useSessionCache} from '@/hooks/web/useCache'
 
-const { wsCache } = useCache()
+const { wsSessionCache } = useSessionCache()
 
 export interface PermissionState {
   routers: AppRouteRecordRaw[]
@@ -35,8 +35,8 @@
       return new Promise<void>(async (resolve) => {
         // 获得菜单列表,它在登录的时候,setUserInfoAction 方法中已经进行获取
         let res: AppCustomRouteRecordRaw[] = []
-        if (wsCache.get(CACHE_KEY.ROLE_ROUTERS)) {
-          res = wsCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
+        if (wsSessionCache.get(CACHE_KEY.ROLE_ROUTERS)) {
+          res = wsSessionCache.get(CACHE_KEY.ROLE_ROUTERS) as AppCustomRouteRecordRaw[]
         }
         const routerMap: AppRouteRecordRaw[] = generateRoute(res)
         // 动态路由,404一定要放到最后面

--
Gitblit v1.9.3