You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.js 547B

123456789101112131415161718192021222324
  1. import { createApp } from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. router.beforeEach((to, from, next) => {
  5. const requiresAuth = false
  6. const requiresProfile = true
  7. if (requiresAuth) {
  8. console.log('You are not authorized to access this area.')
  9. next('login')
  10. } else {
  11. next()
  12. }
  13. // if (requiresProfile) {
  14. // console.log('You must first complete your profile.')
  15. // next('profile')
  16. // } else {
  17. // next()
  18. // }
  19. })
  20. createApp(App).use(router).mount('#app')