This commit is contained in:
2026-06-22 14:22:48 +08:00
parent 721bcd97e4
commit 5d67b30b9a
3 changed files with 7 additions and 3 deletions
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -28,7 +28,7 @@
}
})();
</script>
<script type="module" crossorigin src="/assets/index-DWbCgD5X.js"></script>
<script type="module" crossorigin src="/assets/index-kwLjmXIb.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-D7ShJUt4.css">
</head>
<body>
+5 -1
View File
@@ -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);
}