This commit is contained in:
2026-08-13 11:34:25 +08:00
parent fe855e0fa2
commit 2aa737edaa
3 changed files with 3 additions and 2 deletions
+1
View File
@@ -117,6 +117,7 @@ if (!res.ok) {
// 检测"被踢出"错误 — 单设备登录互斥
if (res.status === 401 && typeof parsed?.detail === 'string' && parsed.detail.includes('其他设备登录')) {
window.dispatchEvent(new CustomEvent('kicked-out', { detail: { message: parsed.detail } }));
throw new Error(parsed.detail); // 阻止后续自动跳转,由通知按钮处理
}
if (res.status === 401 && !options.skipAuthRedirect) {
clearToken();