zycp-demo/src/main.js

37 lines
817 B
JavaScript
Raw Normal View History

2022-03-03 03:28:10 +00:00
import Vue from 'vue'
2022-03-03 03:40:29 +00:00
import axios from 'axios'
import VueAxios from 'vue-axios'
2022-03-03 03:28:10 +00:00
import App from './App.vue'
import router from './router'
2022-03-03 05:41:12 +00:00
// Vue.config.productionTip = false
Vue.prototype.HOME = '/api'
axios.interceptors.request.use(config => {
console.log(config.url)
// config.headers.Authorization = "Basic c2FiZXI6c2FiZXJfc2VjcmV0"
// if (config.url!="/hysc/auth/token") {
// if (!localStorage.token) {
// router.replace('/');
// return config
// }
// }
// config.headers.common['Blade-Auth'] =localStorage.token
// if (config.url!="/hysc/auth/token") {
// if (!localStorage.token) {
// router.replace('/');
// return config
// }
// }
return config
})
2022-03-03 03:40:29 +00:00
Vue.use(VueAxios, axios)
2022-03-03 03:28:10 +00:00
new Vue({
router,
render: h => h(App)
}).$mount('#app')