视频提词优化管理后台配置build dist merge
This commit is contained in:
@@ -110,7 +110,11 @@ export async function apiRequest<T>(path: string, options: RequestOptions = {}):
|
||||
const msg = parsed?.detail || `请求失败 (${res.status})`;
|
||||
if (res.status === 401) {
|
||||
clearToken();
|
||||
window.location.href = '/login';
|
||||
// Only redirect to login if not already on login page
|
||||
const currentPath = window.location.pathname;
|
||||
if (currentPath !== '/login') {
|
||||
window.location.href = '/login';
|
||||
}
|
||||
}
|
||||
throw new Error(msg);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user