fix(projects): fix get user info when page reload

This commit is contained in:
Soybean
2024-06-07 11:28:49 +08:00
parent fe06b8c499
commit ff51b72dac
2 changed files with 18 additions and 7 deletions

View File

@@ -126,9 +126,6 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
// the auth route is initialized
// it is not the "not-found" route, then it is allowed to access
if (routeStore.isInitAuthRoute && !isNotFoundRoute) {
// update user info
await authStore.updateUserInfo();
return null;
}
// it is captured by the "not-found" route, then check whether the route exists
@@ -164,6 +161,8 @@ async function initRoute(to: RouteLocationNormalized): Promise<RouteLocationRaw
return location;
}
await authStore.initUserInfo();
// initialize the auth route
await routeStore.initAuthRoute();