From 85c40424d5f03bd9c2c1c3da8b87b287416f68b8 Mon Sep 17 00:00:00 2001 From: "Apple\\Apple" Date: Tue, 20 May 2025 00:50:09 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9Bfix(session):=20The=20localStorage?= =?UTF-8?q?=20did=20not=20clear=20user=20information=20after=20the=20login?= =?UTF-8?q?=20session=20expired?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/helpers/utils.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web/src/helpers/utils.js b/web/src/helpers/utils.js index 38c25045..35f20c89 100644 --- a/web/src/helpers/utils.js +++ b/web/src/helpers/utils.js @@ -95,6 +95,8 @@ export function showError(error) { if (error.name === 'AxiosError') { switch (error.response.status) { case 401: + // 清除用户状态 + localStorage.removeItem('user'); // toast.error('错误:未登录或登录已过期,请重新登录!', showErrorOptions); window.location.href = '/login?expired=true'; break;