From b3bf5641407312460b1e94a9f9ddc7ebfdfb2fe6 Mon Sep 17 00:00:00 2001 From: Baobhan Sith <80159437+Heavrnl@users.noreply.github.com> Date: Thu, 24 Apr 2025 13:56:00 +0800 Subject: [PATCH] Update auth.store.ts --- packages/frontend/src/stores/auth.store.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/frontend/src/stores/auth.store.ts b/packages/frontend/src/stores/auth.store.ts index 0945543..c7d9a3f 100644 --- a/packages/frontend/src/stores/auth.store.ts +++ b/packages/frontend/src/stores/auth.store.ts @@ -74,7 +74,8 @@ export const useAuthStore = defineStore('auth', { if (this.user?.language) { setLocale(this.user.language); } - await router.push({ name: 'Workspace' }); + // await router.push({ name: 'Workspace' }); // 改为页面刷新 + window.location.href = '/'; // 跳转到根路径并刷新 return { success: true }; } else { // 不应该发生,但作为防御性编程 @@ -110,7 +111,8 @@ export const useAuthStore = defineStore('auth', { if (this.user?.language) { setLocale(this.user.language); } - await router.push({ name: 'Workspace' }); + // await router.push({ name: 'Workspace' }); // 改为页面刷新 + window.location.href = '/'; // 跳转到根路径并刷新 return { success: true }; } catch (err: any) { console.error('2FA 验证失败:', err);