diff --git a/src/app.tsx b/src/app.tsx index f989ec33..65f1563c 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -33,7 +33,8 @@ export async function getInitialState(): Promise<{ return undefined; }; // 如果不是登录页面,执行 - if (window.location.pathname !== loginPath) { + const { location } = history; + if (location.pathname !== loginPath) { const currentUser = await fetchUserInfo(); return { fetchUserInfo,