解决登录回环问题

This commit is contained in:
Cheng Zhou
2025-12-18 12:38:04 +08:00
parent 3f955331c9
commit 1ebc706242
11 changed files with 28 additions and 5 deletions
+2 -1
View File
@@ -242,7 +242,8 @@ router.beforeEach(async (to, _from, next) => {
try {
await auth.fetchMe();
} catch {
/* ignore */
// token 失效或用户不可用时立即登出,避免重复 401
auth.logout();
}
}
if (!to.meta.public && !token) {