From 66a062cf797dc204bea3338b314e6d8c537b588b Mon Sep 17 00:00:00 2001 From: YunaiV Date: Tue, 29 Apr 2025 18:59:32 +0800 Subject: [PATCH] =?UTF-8?q?reactor=EF=BC=9A=E3=80=90=E5=85=A8=E5=B1=80?= =?UTF-8?q?=E3=80=91=E5=88=B7=E6=96=B0=E6=97=B6=EF=BC=8C=E4=B8=BB=E5=8A=A8?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=9C=80=E6=96=B0=E8=8F=9C=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/modules/user.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/store/modules/user.ts b/src/store/modules/user.ts index c3920c71..6876043e 100644 --- a/src/store/modules/user.ts +++ b/src/store/modules/user.ts @@ -56,6 +56,11 @@ export const useUserStore = defineStore('admin-user', { let userInfo = wsCache.get(CACHE_KEY.USER) if (!userInfo) { userInfo = await getInfo() + } else { + // 特殊:在有缓存的情况下,进行加载。但是即使加载失败,也不影响后续的操作,保证可以进入系统 + try { + userInfo = await getInfo() + } catch (error) {} } this.permissions = new Set(userInfo.permissions) this.roles = userInfo.roles