fix: 🐛 注销登录未能重定向登录页面问题修复
This commit is contained in:
@@ -52,14 +52,17 @@ import Notification from "./Notification.vue";
|
|||||||
const appStore = useAppStore();
|
const appStore = useAppStore();
|
||||||
const settingStore = useSettingsStore();
|
const settingStore = useSettingsStore();
|
||||||
const userStore = useUserStore();
|
const userStore = useUserStore();
|
||||||
|
const tagsViewStore = useTagsViewStore();
|
||||||
|
|
||||||
|
const route = useRoute();
|
||||||
|
const router = useRouter();
|
||||||
const isDesktop = computed(() => appStore.device === DeviceEnum.DESKTOP);
|
const isDesktop = computed(() => appStore.device === DeviceEnum.DESKTOP);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 打开个人中心页面
|
* 打开个人中心页面
|
||||||
*/
|
*/
|
||||||
function handleProfileClick() {
|
function handleProfileClick() {
|
||||||
useRouter().push({ name: "Profile" });
|
router.push({ name: "Profile" });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -75,10 +78,10 @@ function logout() {
|
|||||||
userStore
|
userStore
|
||||||
.logout()
|
.logout()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
useTagsViewStore().delAllViews();
|
tagsViewStore.delAllViews();
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
useRouter().push(`/login?redirect=${useRoute().fullPath}`);
|
router.push(`/login?redirect=${route.fullPath}`);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user