perf(app-layout): optimize loadingBar behavior when logout

This commit is contained in:
yangsy
2025-11-06 16:09:23 +08:00
parent 45cf9330cf
commit 247da9e9f4

View File

@@ -133,8 +133,13 @@ const dropdownOptions = ref<DropdownOption[]>([
key: 'logout', key: 'logout',
icon: renderIcon(LogoutOutlined), icon: renderIcon(LogoutOutlined),
onClick: async () => { onClick: async () => {
await userStore.userLogout(); await userStore
.userLogout()
.then(() => {
window.$loadingBar.finish();
router.push('/login'); router.push('/login');
})
.catch(() => window.$message.error('退出登录失败'));
}, },
}, },
]); ]);