Skip to content

Commit 60dd226

Browse files
committed
fix(projects): fix login success notification. fixed #688
1 parent 5676024 commit 60dd226

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

src/hooks/common/router.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ export function useRouterPush(inSetup = true) {
102102
const redirect = route.value.query?.redirect as string;
103103

104104
if (needRedirect && redirect) {
105-
routerPush(redirect);
105+
await routerPush(redirect);
106106
} else {
107-
toHome();
107+
await toHome();
108108
}
109109
}
110110

src/store/modules/auth/index.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,11 @@ export const useAuthStore = defineStore(SetupStoreId.Auth, () => {
7171
if (pass) {
7272
await redirectFromLogin(redirect);
7373

74-
if (routeStore.isInitAuthRoute) {
75-
window.$notification?.success({
76-
title: $t('page.login.common.loginSuccess'),
77-
content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }),
78-
duration: 4500
79-
});
80-
}
74+
window.$notification?.success({
75+
title: $t('page.login.common.loginSuccess'),
76+
content: $t('page.login.common.welcomeBack', { userName: userInfo.userName }),
77+
duration: 4500
78+
});
8179
}
8280
} else {
8381
resetStore();

0 commit comments

Comments
 (0)