fix: initialState refresh

This commit is contained in:
jialin
2024-08-27 14:15:29 +08:00
parent 2b1f5d38e1
commit 9a0aeb491a
6 changed files with 51 additions and 55 deletions
+1 -6
View File
@@ -8,7 +8,6 @@ import {
import { RequestConfig, history } from '@umijs/max';
const loginPath = '/login';
let currentUserInfo: any = {};
// 运行时配置
export async function getInitialState(): Promise<{
@@ -42,9 +41,7 @@ export async function getInitialState(): Promise<{
if (![loginPath].includes(location.pathname)) {
const userInfo = await fetchUserInfo();
currentUserInfo = {
...userInfo
};
return {
fetchUserInfo,
currentUser: userInfo
@@ -55,8 +52,6 @@ export async function getInitialState(): Promise<{
};
}
console.log('app.tsx');
export const request: RequestConfig = {
baseURL: ' /v1',
...requestConfig