Просмотр исходного кода

fix: fetchUserInfo不直接跳转登录,避免与错误处理器冲突导致SSO登录后误跳

kinglee 1 неделя назад
Родитель
Сommit
833f9df927
1 измененных файлов с 3 добавлено и 7 удалено
  1. 3 7
      src/app.tsx

+ 3 - 7
src/app.tsx

@@ -72,9 +72,7 @@ export async function getInitialState(): Promise<{
     }
   };
 
-  const fetchUserInfo = async (config?: {
-    skipErrorHandler?: boolean;
-  }): Promise<Global.UserInfo> => {
+  const fetchUserInfo = async (): Promise<Global.UserInfo> => {
     try {
       const data = await queryCurrentUserState({
         skipErrorHandler: true
@@ -96,10 +94,8 @@ export async function getInitialState(): Promise<{
           duration: 5
         });
       }
-      // Only redirect if not skipping error handler, or if error is not 401
-      if (!config?.skipErrorHandler) {
-        history.push(DEFAULT_ENTER_PAGE.login);
-      }
+      // Don't redirect here — let the error handler do it
+      // This avoids double-redirect and respects skipErrorHandler
     }
     return {} as Global.UserInfo;
   };