fix: 🐛 注销登录未能重定向登录页面问题修复
This commit is contained in:
@@ -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}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user