import router from './router'
import store from './store/index'


router.beforeEach((to, from, next) => {
    if (to.matched.some(record => record.meta.requiresAuth)){
        //判断用户是否登录
        const token = store.state.loginModules.token
        return token ? next() : next({path:'/login'})

    }else{
        next()
    }
})