每次路由变化时,判断是否登录、是否有权限
注入拦截器
@/router/index.js:
1 | import { routerBeforeEachFunc, routerAfterEachFunc } from '@/config/interceptor/router'; |
@/index.js:
1 | import router from '@/router'; |
拦截器设置
设置loadingBar,判断是否登录、是否有权限
@/config/interceptor:
1 | import router from '@/router'; |
引用模块
@/utils/auth.js:
1 | import Cookies from 'js-cookie'; |
@/utils/index.js:
1 | export function treeToList(routeList) { |
@/store/user.js:
1 | const user = { |