refactor: 手动登出时不带上重定向地址

This commit is contained in:
Hooray Hu 2024-07-31 15:39:18 +08:00
parent bd5c921bca
commit 571190cd78
2 changed files with 2 additions and 2 deletions

View File

@ -40,7 +40,7 @@ watch(() => userStore.avatar, () => {
{ label: '快捷键介绍', handle: () => eventBus.emit('global-hotkeys-intro-toggle'), hide: settingsStore.mode !== 'pc' },
],
[
{ label: '退出登录', handle: () => userStore.logout() },
{ label: '退出登录', handle: () => userStore.logout(settingsStore.settings.home.fullPath) },
],
]" class="flex-center cursor-pointer px-2"
>

View File

@ -50,7 +50,7 @@ const useUserStore = defineStore(
router.push({
name: 'login',
query: {
...(router.currentRoute.value.path !== settingsStore.settings.home.fullPath && router.currentRoute.value.name !== 'login' && { redirect }),
...(redirect !== settingsStore.settings.home.fullPath && router.currentRoute.value.name !== 'login' && { redirect }),
},
})
}