fix: oauth登录菜单会折叠一次(二次路由跳转导致)

- 修复oauth登录后 菜单会折叠一次(函数和finally都执行了路由跳转)
- 加载中Spin效果
This commit is contained in:
dap 2025-09-11 20:54:38 +08:00
parent 0c081031c2
commit 02de029e6f

View File

@ -4,8 +4,7 @@ import type { AuthApi } from '#/api';
import { onMounted } from 'vue';
import { useRoute, useRouter } from 'vue-router';
import { DEFAULT_TENANT_ID } from '@vben/constants';
import { preferences } from '@vben/preferences';
import { DEFAULT_TENANT_ID, LOGIN_PATH } from '@vben/constants';
import { useAccessStore } from '@vben/stores';
import { cn } from '@vben/utils';
@ -64,15 +63,15 @@ onMounted(async () => {
await authCallback(data);
message.success(`${source}授权成功`);
} else {
// todo
//
await authStore.authLogin(data as any);
message.success(`${source}登录成功`);
}
} catch {
} catch (error) {
console.error(error);
// 500
} finally {
setTimeout(() => {
router.push(preferences.app.defaultHomePath);
router.push(LOGIN_PATH);
}, 1500);
}
});