优化用户登录账号删除的情况

This commit is contained in:
2025-05-18 21:28:55 +08:00
parent e25c4f0455
commit ef7dae1bae

View File

@@ -51,6 +51,12 @@ export function NavUser({ }: {}) {
}
);
if (!isLoading && !error && !user) {
router.replace('/console/login');
localStorage.removeItem('token');
toast.error('账户状态异常,请重新登录');
}
async function logout() {
try {
await authApi.logout();