From c94c8454b2e944f01a4e98f1f61521778d3c56dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=80=E5=AF=B8=E7=81=B0?= Date: Fri, 3 Jan 2025 21:55:38 +0800 Subject: [PATCH] fix(projects): :bug: fix login success notification. (#45) --- 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 4a43342..4ab21ea 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 96371c3..9beb2d7 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'), - message: $t('page.login.common.welcomeBack', { userName: userInfo.userName }), - duration: 4500 - }); - } + window.$notification?.success({ + title: $t('page.login.common.loginSuccess'), + message: $t('page.login.common.welcomeBack', { userName: userInfo.userName }), + duration: 4500 + }); } } else { resetStore();