import router from './router'
import {
  getToken
} from '@/utils/auth' // get token from cookie


router.beforeEach(async (to, from, next) => {
  console.log(from,to);
  const hasToken = getToken()
  if (!hasToken) {
    if (to.path === '/personal') {
      next({
        path: '/'
      })
    } else {
      next()
    }
  } else {
    next()
  }
})
