解决登录回环问题
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user