标签:intercept UNC imp axios ISE mis response out router
import Vue from 'vue'
// import App from './App.vue'
import router from './router'
import store from './store'
import axios from 'axios'
//添加自定义的全局方法
import globalFunc from "./utils/globalFunc"
Vue.use(globalFunc)
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import '@/styles/index.scss' //global css
import * as filters from './filters' //global filters
import bus from './components/bus'
Vue.prototype.$http = axios
Vue.prototype.$bus = bus
// register global utility filters.
Object.keys(filters).forEach(key => {
Vue.filter(key, filters[key])
});
// // 添加请求拦截器
// axios.interceptors.request.use((config)=> {
// console.log(config,544)
// // 在发送请求之前做些什么
// return config;
// },(error)=> {
// // 对请求错误做些什么
// return Promise.reject(error);
// });
// // 添加响应拦截器
// axios.interceptors.response.use( (response)=> {
// console.log(response,9879879)
// // 对响应数据做点什么
// return response;
// }, (error)=> {
// // 对响应错误做点什么
// return Promise.reject(error);
// });
Vue.config.productionTip = false
Vue.use(ElementUI)
new Vue({
router,
axios,
store,
}).$mount('#app')
标签:intercept UNC imp axios ISE mis response out router
原文地址:https://www.cnblogs.com/knuzy/p/11374490.html