diff --git a/apps/web/src/api/client.ts b/apps/web/src/api/client.ts index 3b06edd82..97521537b 100644 --- a/apps/web/src/api/client.ts +++ b/apps/web/src/api/client.ts @@ -69,7 +69,7 @@ apiClient.interceptors.response.use( // 无 refresh_token → 直接登出 if (!refreshToken) { useAuthStore.getState().clearAuth(); - window.location.href = "/login"; + window.location.href = "/"; return Promise.reject(error); } @@ -114,7 +114,7 @@ apiClient.interceptors.response.use( // 刷新失败 → 登出 processQueue(refreshError, null); useAuthStore.getState().clearAuth(); - window.location.href = "/login"; + window.location.href = "/"; return Promise.reject(refreshError); } finally { isRefreshing = false; diff --git a/apps/web/src/hooks/useAuth.ts b/apps/web/src/hooks/useAuth.ts index 2ad569c6c..224e10c2d 100644 --- a/apps/web/src/hooks/useAuth.ts +++ b/apps/web/src/hooks/useAuth.ts @@ -75,7 +75,7 @@ export const useLogout = () => { } finally { clearAuth(); queryClient.clear(); - navigate("/login"); + navigate("/"); } };