Эх сурвалжийг харах

修复统一登陆按钮问题

lxylxy123321 6 өдөр өмнө
parent
commit
b755f36ffb

+ 3 - 12
frontend/src/pages/AuthLogin.tsx

@@ -10,18 +10,9 @@ export function Login() {
     if (isAuthenticated) navigate('/')
   }, [isAuthenticated, navigate])
 
-  const handleSSOLogin = async () => {
-    try {
-      const res = await fetch('/auth/sso/authorize?redirect=true')
-      // 如果不是 redirect=true,则获取 URL 并跳转
-      if (!res.redirected) {
-        const data = await res.json()
-        window.location.href = data.data?.authorize_url
-      }
-    } catch {
-      // 降级:直接跳转 SSO 授权页
-      window.location.href = '/auth/sso/authorize?redirect=true'
-    }
+  const handleSSOLogin = () => {
+    // 直接让浏览器处理 307 重定向到 SSO 授权页
+    window.location.href = '/auth/sso/authorize?redirect=true'
   }
 
   return (