fix: 🐛 注销登录未能重定向登录页面问题修复

This commit is contained in:
Ray.Hao
2025-02-15 16:34:36 +08:00
parent 031cb74da8
commit b450539e10

View File

@@ -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}`);
});
});
}