mirror of
https://gitee.com/myxzgzs/boyue-ui-admin-vue3
synced 2025-08-08 08:22:41 +08:00
reactor:【全局】刷新时,主动加载最新菜单数据
This commit is contained in:
parent
bc6fadca41
commit
66a062cf79
@ -56,6 +56,11 @@ export const useUserStore = defineStore('admin-user', {
|
|||||||
let userInfo = wsCache.get(CACHE_KEY.USER)
|
let userInfo = wsCache.get(CACHE_KEY.USER)
|
||||||
if (!userInfo) {
|
if (!userInfo) {
|
||||||
userInfo = await getInfo()
|
userInfo = await getInfo()
|
||||||
|
} else {
|
||||||
|
// 特殊:在有缓存的情况下,进行加载。但是即使加载失败,也不影响后续的操作,保证可以进入系统
|
||||||
|
try {
|
||||||
|
userInfo = await getInfo()
|
||||||
|
} catch (error) {}
|
||||||
}
|
}
|
||||||
this.permissions = new Set(userInfo.permissions)
|
this.permissions = new Set(userInfo.permissions)
|
||||||
this.roles = userInfo.roles
|
this.roles = userInfo.roles
|
||||||
|
Loading…
x
Reference in New Issue
Block a user