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',
icon: renderIcon(LogoutOutlined),
onClick: async () => {
await userStore.userLogout();
router.push('/login');
await userStore
.userLogout()
.then(() => {
window.$loadingBar.finish();
router.push('/login');
})
.catch(() => window.$message.error('退出登录失败'));
},
},
]);