From b450539e1019151c399c7aeb7202a09de1a7709d Mon Sep 17 00:00:00 2001 From: "Ray.Hao" <1490493387@qq.com> Date: Sat, 15 Feb 2025 16:34:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20:bug:=20=E6=B3=A8=E9=94=80=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E6=9C=AA=E8=83=BD=E9=87=8D=E5=AE=9A=E5=90=91=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E9=A1=B5=E9=9D=A2=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/layout/components/NavBar/components/NavbarRight.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/layout/components/NavBar/components/NavbarRight.vue b/src/layout/components/NavBar/components/NavbarRight.vue index a1489693..4e841c6c 100644 --- a/src/layout/components/NavBar/components/NavbarRight.vue +++ b/src/layout/components/NavBar/components/NavbarRight.vue @@ -52,14 +52,17 @@ import Notification from "./Notification.vue"; const appStore = useAppStore(); const settingStore = useSettingsStore(); const userStore = useUserStore(); +const tagsViewStore = useTagsViewStore(); +const route = useRoute(); +const router = useRouter(); const isDesktop = computed(() => appStore.device === DeviceEnum.DESKTOP); /** * 打开个人中心页面 */ function handleProfileClick() { - useRouter().push({ name: "Profile" }); + router.push({ name: "Profile" }); } /** @@ -75,10 +78,10 @@ function logout() { userStore .logout() .then(() => { - useTagsViewStore().delAllViews(); + tagsViewStore.delAllViews(); }) .then(() => { - useRouter().push(`/login?redirect=${useRoute().fullPath}`); + router.push(`/login?redirect=${route.fullPath}`); }); }); }