From c9a6f7cbb5209415e626df29c7572cf40fe92b66 Mon Sep 17 00:00:00 2001 From: houzhongjian <houzhongyi@126.com> Date: 星期一, 06 一月 2025 11:44:50 +0800 Subject: [PATCH] 1、工作流程功能优化,解决流程图模拟功能simulation不生效的bug 2、system menu等页面修改 3、Footer copyright年份修改为动态 --- src/store/modules/user.ts | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index b386180..e4c45fd 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -1,10 +1,17 @@ import { store } from '@/store' import { defineStore } from 'pinia' import { getAccessToken, removeToken } from '@/utils/auth' -import { CACHE_KEY, useCache, deleteUserCache } from '@/hooks/web/useCache' +import { + CACHE_KEY, + useCache, + deleteUserCache, + useSessionCache, + deleteUserSessionCache +} from '@/hooks/web/useCache' import { getInfo, loginOut } from '@/api/login' const { wsCache } = useCache() +const { wsSessionCache } = useSessionCache() interface UserVO { id: number @@ -62,7 +69,9 @@ this.user = userInfo.user this.isSetUser = true wsCache.set(CACHE_KEY.USER, userInfo) - wsCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus) + if(!wsSessionCache.get(CACHE_KEY.ROLE_ROUTERS)) { + wsSessionCache.set(CACHE_KEY.ROLE_ROUTERS, userInfo.menus) + } }, async setUserAvatarAction(avatar: string) { const userInfo = wsCache.get(CACHE_KEY.USER) @@ -82,6 +91,7 @@ await loginOut() removeToken() deleteUserCache() // 删除用户缓存 + deleteUserSessionCache() //删除路由缓存 this.resetState() }, resetState() { -- Gitblit v1.9.3