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

const loginWhiteList = ['/'] // 登录验证白名单

router.beforeEach((to, from, next) => {
  // 线上注释
//   next()
//   return

  if (store.getters.user.user.id == 0) {
    if (loginWhiteList.indexOf(to.path) !== -1) {
      next()
    } else {
      next({ path: '/'})
    }
  } else {
    next()
  }
})
