| | |
| | | import { useNProgress } from '@/hooks/web/useNProgress' |
| | | import { usePageLoading } from '@/hooks/web/usePageLoading' |
| | | import { useDictStoreWithOut } from '@/store/modules/dict' |
| | | import { useCheckTypeStoreWithOut } from '@/store/modules/checkType' |
| | | import { useUserStoreWithOut } from '@/store/modules/user' |
| | | import { usePermissionStoreWithOut } from '@/store/modules/permission' |
| | | |
| | |
| | | '/auth-redirect', |
| | | '/bind', |
| | | '/register', |
| | | '/oauthLogin/gitee' |
| | | '/oauthLogin/gitee', |
| | | '/calling-screen-big', |
| | | '/calling-screen-room' |
| | | ] |
| | | |
| | | // 路由加载前 |
| | |
| | | console.info("router.beforeEach to: " + to.fullPath + " from: " + from.fullPath) |
| | | start() |
| | | loadStart() |
| | | |
| | | if (whiteList.indexOf(to.path) !== -1) { |
| | | next() |
| | | return |
| | | } |
| | | |
| | | if (!getAccessToken()) { |
| | | if (whiteList.indexOf(to.path) !== -1) { |
| | | next() |
| | | return |
| | | } else { |
| | | next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 |
| | | return |
| | | } |
| | | next(`/login?redirect=${to.fullPath}`) // 否则全部重定向到登录页 |
| | | return |
| | | } |
| | | |
| | | if (to.path === '/login') { |
| | |
| | | // 获取所有字典 |
| | | const dictStore = useDictStoreWithOut() |
| | | const userStore = useUserStoreWithOut() |
| | | const checkTypeStore = useCheckTypeStoreWithOut() |
| | | const permissionStore = usePermissionStoreWithOut() |
| | | if (!dictStore.getIsSetDict) { |
| | | await dictStore.setDictMap() |
| | | } |
| | | if (!checkTypeStore.getIsSetCheckType) { |
| | | await checkTypeStore.setCheckTypeMap() |
| | | } |
| | | |
| | | if (userStore.getIsSetUser ) { |
| | | |