diff --git a/src/components/auth/authorizing.tsx b/src/components/auth/authorizing.tsx index 9a6aace..f286fd9 100644 --- a/src/components/auth/authorizing.tsx +++ b/src/components/auth/authorizing.tsx @@ -10,7 +10,6 @@ export function Authorizing() { const router = useRouter(); const searchParams = useSearchParams(); const [error, setError] = useState(null); - const [isLoading, setIsLoading] = useState(true); const signInCallback = useCallback(async () => { try { @@ -18,9 +17,8 @@ export function Authorizing() { router.push(url); } catch (error) { setError(error); - setIsLoading(false); } - }, [router, searchParams]); + }, []); useEffect(() => { // Delay 3s get sso url go to ... @@ -28,43 +26,41 @@ export function Authorizing() { return () => { clearTimeout(timer); }; - }, [signInCallback]); - - if (error) { - return ( - - -
-
-
- - 授权失败 - -
- -

- {error instanceof Error - ? error.message - : "授权异常,登录失败!请稍后重试。"} -

-
-
- ); - } + }, []); return ( - - -
-
-
- 正在处理授权 -
- -

- {isLoading ? "请稍候,我们正在处理您的授权请求" : "正在跳转..."} -

-
-
+ <> + {error ? ( + + +
+
+
+ + 授权失败 + +
+ +

授权异常,登录失败!

+
+
+ ) : ( + + +
+
+
+ + 正在处理授权 + +
+ +

+ 请稍候,我们正在处理您的授权请求 +

+
+
+ )} + ); }