daily pastebin goal
70%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 51 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Vue from 'vue'
  2. import App from './App.vue'
  3. import router from './router'
  4. import axios from 'axios'
  5. import VueAxios from 'vue-axios'
  6.  
  7. axios.defaults.baseURL = 'http://localhost:3000'
  8. axios.defaults.headers.common['Authorization'] = "Bearer" + localStorage.getItem('jwtToken')
  9.  
  10. Vue.use(VueAxios, axios)
  11.  
  12. router.beforeEach((to, from, next) => {
  13.     if (to.meta.requiresAuth) {
  14.         if (**O QUE COLOCO AQUI SEM UTILIZAR O VUEX?**) {
  15.             next()
  16.         } else {
  17.             next('/')
  18.         }
  19.     } else {
  20.         next()
  21.     }
  22. })
  23.  
  24. new Vue({
  25.   el: '#app',
  26.   router,
  27.   axios,
  28.   render: h => h(App)
  29. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top