Update auth.store.ts

This commit is contained in:
Baobhan Sith
2025-04-24 13:56:00 +08:00
parent dcb679be54
commit b3bf564140
+4 -2
View File
@@ -74,7 +74,8 @@ export const useAuthStore = defineStore('auth', {
if (this.user?.language) { if (this.user?.language) {
setLocale(this.user.language); setLocale(this.user.language);
} }
await router.push({ name: 'Workspace' }); // await router.push({ name: 'Workspace' }); // 改为页面刷新
window.location.href = '/'; // 跳转到根路径并刷新
return { success: true }; return { success: true };
} else { } else {
// 不应该发生,但作为防御性编程 // 不应该发生,但作为防御性编程
@@ -110,7 +111,8 @@ export const useAuthStore = defineStore('auth', {
if (this.user?.language) { if (this.user?.language) {
setLocale(this.user.language); setLocale(this.user.language);
} }
await router.push({ name: 'Workspace' }); // await router.push({ name: 'Workspace' }); // 改为页面刷新
window.location.href = '/'; // 跳转到根路径并刷新
return { success: true }; return { success: true };
} catch (err: any) { } catch (err: any) {
console.error('2FA 验证失败:', err); console.error('2FA 验证失败:', err);