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/layout/components/Logo/src/Logo.vue |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/layout/components/Logo/src/Logo.vue b/src/layout/components/Logo/src/Logo.vue
index 98b17c3..ef80370 100644
--- a/src/layout/components/Logo/src/Logo.vue
+++ b/src/layout/components/Logo/src/Logo.vue
@@ -7,8 +7,11 @@
 import {isRelogin} from "@/config/axios/service";
 import router from "@/router";
 import type {RouteRecordRaw} from "vue-router";
-import {CACHE_KEY, useCache} from "@/hooks/web/useCache";
+import {CACHE_KEY, useCache, useSessionCache} from "@/hooks/web/useCache";
+import {getAccessToken} from "@/utils/auth";
+import {getInfo} from "@/api/login";
 const { wsCache } = useCache()
+const { wsSessionCache } = useSessionCache()
 
 defineOptions({ name: 'Logo' })
 
@@ -68,11 +71,11 @@
 
 /** 刷新所有菜单权限 */
 const gotoHome = async () => {
-  const userStore = useUserStoreWithOut()
   const permissionStore = usePermissionStoreWithOut()
   isRelogin.show = true
-  wsCache.set(CACHE_KEY.USER, null)
-  await userStore.setUserInfoAction()
+  let userInfo = await getInfo()
+  wsCache.set(CACHE_KEY.USER, userInfo)
+  wsSessionCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus)
   isRelogin.show = false
   // 后端过滤菜单
   await permissionStore.generateRoutes()

--
Gitblit v1.9.3