修复 登录之后 一直跳转的问题

This commit is contained in:
mmc
2026-10-14 11:30:33 +08:00
parent 51444b0142
commit 4e1356b8af

View File

@@ -1,4 +1,4 @@
import axios, { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
import axios, { AxiosError, AxiosResponse, InternalAxiosRequestConfig } from 'axios';
import envConfig from '../../env';
import Cookies from 'js-cookie';
import utils from '../lib/utils';
@@ -47,6 +47,11 @@ const handleLogoutAndRedirect = () => {
// 已经在登出流程中,直接阻止
if (isLoggingOut) return;
// 如果当前已经在登录页,不再跳转,防止死循环
if (window.location.pathname === '/login') {
return;
}
// 立即上锁
isLoggingOut = true;