| | |
| | | import type { Router } from 'vue-router'; |
| | | |
| | | import { LOGIN_PATH } from '..\packages\constants\src'; |
| | | import { $t } from '..\packages\locales\src'; |
| | | import { preferences } from '..\packages\preferences\src'; |
| | | import { useAccessStore, useDictStore, useUserStore } from '..\packages\stores\src'; |
| | | import { startProgress, stopProgress } from '..\packages\utils\src'; |
| | | import { LOGIN_PATH } from '@vben/constants'; |
| | | import { $t } from '@vben/locales'; |
| | | import { preferences } from '@vben/preferences'; |
| | | import { useAccessStore, useDictStore, useUserStore } from '@vben/stores'; |
| | | import { startProgress, stopProgress } from '@vben/utils'; |
| | | |
| | | import { message } from 'ant-design-vue'; |
| | | |
| | |
| | | if (to.path === LOGIN_PATH && accessStore.accessToken) { |
| | | return decodeURIComponent( |
| | | (to.query?.redirect as string) || |
| | | userStore.userInfo?.homePath || |
| | | preferences.app.defaultHomePath, |
| | | '/analytics', |
| | | ); |
| | | } |
| | | return true; |
| | |
| | | userStore.setUserRoles(userRoles); |
| | | const redirectPath = (from.query.redirect ?? |
| | | (to.path === preferences.app.defaultHomePath |
| | | ? userInfo?.homePath || preferences.app.defaultHomePath |
| | | ? '/analytics' |
| | | : to.fullPath)) as string; |
| | | |
| | | return { |