From 9f4fb8c3fbb1b8af384ee70e5dfd82263a33c2ad Mon Sep 17 00:00:00 2001 From: Soybean Date: Wed, 11 Dec 2024 12:38:28 +0800 Subject: [PATCH] fix(projects): check if init userInfo when initAuthRoute. fixed #680 --- src/store/modules/route/index.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/store/modules/route/index.ts b/src/store/modules/route/index.ts index a3f25698..beb7443e 100644 --- a/src/store/modules/route/index.ts +++ b/src/store/modules/route/index.ts @@ -176,6 +176,11 @@ export const useRouteStore = defineStore(SetupStoreId.Route, () => { /** Init auth route */ async function initAuthRoute() { + // check if user info is initialized + if (!authStore.userInfo.userId) { + await authStore.initUserInfo(); + } + if (authRouteMode.value === 'static') { initStaticAuthRoute(); } else {