修复个人中心问题
This commit is contained in:
1 parent
0dc5c2f075
commit
ca4220f92c
44 files changed
+1793
-310
No files matched your search
@@ -16,13 +16,16 @@ export const useMenuStore = defineStore('menu', () => {
|
||||
// 正在加载的 Promise(用于避免重复请求)
|
||||
let loadingPromise = null;
|
||||
|
||||
// 菜单缓存 key(基于用户类型和角色ID)
|
||||
// 菜单缓存 key(基于用户类型、当前企业与角色ID)
|
||||
// 必须带 tid:菜单是按企业下发的,key 里没有企业会让「切换企业」后
|
||||
// 直接复用上一家的菜单,导致新企业未开通的模块仍能进入。
|
||||
const getCacheKey = () => {
|
||||
try {
|
||||
const userInfo = JSON.parse(localStorage.getItem('userInfo') || '{}');
|
||||
const loginType = userInfo.type || 'user';
|
||||
const roleId = userInfo.group_id || 0;
|
||||
return `menu_cache_${loginType}_${roleId}`;
|
||||
const tid = userInfo.tid || 0;
|
||||
return `menu_cache_${loginType}_${tid}_${roleId}`;
|
||||
} catch (e) {
|
||||
return 'menu_cache_default';
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user