axios.interceptors.request.use(cfg => {
if (cfg.signRequest) {
cfg.headers['Token'] = store.state.token
}
return cfg
})
this.$http.defaults.headers['Authorization'] = localStorage.token || ''
const res = await Vue.axios.post('/auth/login', user)
import Vue from 'vue'
import App from './App'
import Vuetify from 'vuetify'
import router from './router'
import axios from 'axios'
import store from './store';
import i18n from '@/i18n.js'
Vue.config.productionTip = false
Vue.use(Vuetify)
Vue.axios = Vue.prototype.$http = axios.create({
baseURL: 'http://localhost:5000/api'
})
new Vue({
el: '#app',
i18n,
router,
store,
components: { App },
template: '<App/>',
})