From f208db9d5c1194fc3f11c093c0f9c9c651c99ad3 Mon Sep 17 00:00:00 2001 From: Kkuil317 <102936058+Kkuil@users.noreply.github.com> Date: Sun, 24 Sep 2023 16:09:53 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E9=80=80=E5=87=BA=E7=99=BB=E5=BD=95=EF=BC=8C=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E7=BC=93=E5=AD=98=E9=97=AE=E9=A2=98=20(#98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Evan --- src/stores/user.ts | 5 +++++ src/views/Home/components/ToolBar/index.vue | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stores/user.ts b/src/stores/user.ts index bafdea87..243e7760 100644 --- a/src/stores/user.ts +++ b/src/stores/user.ts @@ -26,6 +26,11 @@ export const useUserStore = defineStore('user', () => { .then((data) => { userInfo.value = { ...userInfo.value, ...data } }) + .catch(()=> { + // 删除缓存 + localStorage.removeItem("TOKEN") + localStorage.removeItem("USER_INFO") + }) } return { userInfo, isSign, getUserDetailAction } diff --git a/src/views/Home/components/ToolBar/index.vue b/src/views/Home/components/ToolBar/index.vue index 533c7603..8eb48820 100644 --- a/src/views/Home/components/ToolBar/index.vue +++ b/src/views/Home/components/ToolBar/index.vue @@ -65,7 +65,7 @@ const menuList = [