Update auth.store.ts
This commit is contained in:
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user