feat: 退出登录后跳转首页(/)而非登录页(/login)
CI/CD Pipeline / Build Production Runtime Images (push) Has been skipped
CI/CD Pipeline / Deploy Production (push) Has been skipped
CI/CD Pipeline / Production Browser E2E (push) Has been skipped
CI/CD Pipeline / Staging E2E Tests (push) Failing after 53h21m49s
CI/CD Pipeline / Deploy Staging (push) Failing after 53h22m44s
CI/CD Pipeline / Frontend Lint (push) Failing after 53h23m14s
CI/CD Pipeline / Validate Code Quality And Tests (push) Failing after 53h24m0s

- useLogout hook: navigate('/login') → navigate('/')
- client.ts 无refresh_token自动登出: href='/login' → href='/'
- client.ts 刷新失败自动登出: href='/login' → href='/'
- 已排查所有退出入口:仅Header头像菜单有手动退出按钮,行为一致
- ProtectedRoute未登录拦截仍跳/login(正确行为,非退出场景)
This commit is contained in:
灵应
2026-07-07 07:30:13 +08:00
parent 9d2f4ec0f2
commit e33bfe71bf
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -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;
+1 -1
View File
@@ -75,7 +75,7 @@ export const useLogout = () => {
} finally {
clearAuth();
queryClient.clear();
navigate("/login");
navigate("/");
}
};