From 60dd22624bb50621fc19f87bb0573f55bb0887e0 Mon Sep 17 00:00:00 2001 From: Soybean Date: Thu, 26 Dec 2024 11:07:19 +0800 Subject: [PATCH] fix(projects): fix login success notification. fixed #688 --- src/hooks/common/router.ts | 4 ++-- src/store/modules/auth/index.ts | 12 +++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/hooks/common/router.ts b/src/hooks/common/router.ts index 4a433420..4ab21ea0 100644 --- a/src/hooks/common/router.ts +++ b/src/hooks/common/router.ts @@ -102,9 +102,9 @@ export function useRouterPush(inSetup = true) { const redirect = route.value.query?.redirect as string; if (needRedirect && redirect) { - routerPush(redirect); + await routerPush(redirect); } else { - toHome(); + await toHome(); } } diff --git a/src/store/modules/auth/index.ts b/src/store/modules/auth/index.ts index 40494884..74e67ccc 100644 --- a/src/store/modules/auth/index.ts +++ b/src/store/modules/auth/index.ts @@ -71,13 +71,11 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => { if (pass) { await redirectFromLogin(redirect); - if (routeStore.isInitAuthRoute) { - window.$notification?.success({ - title: $t('page.login.common.loginSuccess'), - content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }), - duration: 4500 - }); - } + window.$notification?.success({ + title: $t('page.login.common.loginSuccess'), + content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }), + duration: 4500 + }); } } else { resetStore();