| | |
| | | const dictStore = useDictStore(); |
| | | |
| | | // 基本路由,这些路由不需要进入权限拦截 |
| | | if (coreRouteNames.includes(to.name as string)) { |
| | | // Personal settings are available to every signed-in account and still |
| | | // pass through token validation and user/menu initialization below. |
| | | if (to.name === 'Profile') to.meta.fullPathKey = false; |
| | | if (coreRouteNames.includes(to.name as string) && to.name !== 'Profile') { |
| | | 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 { |