Skip to content

Commit

Permalink
fix(projects): fix login success notification. fixed #688
Browse files Browse the repository at this point in the history
  • Loading branch information
honghuangdc committed Dec 26, 2024
1 parent 5676024 commit 60dd226
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/hooks/common/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
12 changes: 5 additions & 7 deletions src/store/modules/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 60dd226

Please sign in to comment.