🔨 优化错误提示.

This commit is contained in:
lijiahangmax
2025-10-17 14:14:34 +08:00
parent f648e18557
commit 0649c4e3de
5 changed files with 26 additions and 5 deletions

View File

@@ -31,7 +31,10 @@ export default function setupUserLoginInfoGuard(router: Router) {
next();
}
} catch (error) {
Message.error('获取用户信息失败');
// 登录过期
if ((error as any)?.data?.data?.code !== 401) {
Message.error('获取用户信息失败');
}
// 获取失败退出登录
await userStore.logout();
next({