From ef7dae1bae1a0c1767f0123a56ccf983fc2e88c0 Mon Sep 17 00:00:00 2001 From: tone <3341154833@qq.com> Date: Sun, 18 May 2025 21:28:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E8=B4=A6=E5=8F=B7=E5=88=A0=E9=99=A4=E7=9A=84=E6=83=85?= =?UTF-8?q?=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tone-page-web/components/nav-user.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tone-page-web/components/nav-user.tsx b/tone-page-web/components/nav-user.tsx index c215d46..d7f041c 100644 --- a/tone-page-web/components/nav-user.tsx +++ b/tone-page-web/components/nav-user.tsx @@ -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();