This commit is contained in:
尹吉欢
2018-03-27 14:56:53 +08:00
parent c42e41c5fc
commit 51dd554193
+17
View File
@@ -0,0 +1,17 @@
axios.defaults.baseURL = BASE_PATH;
axios.defaults.headers.post['Content-Type'] = 'application/json';
// 添加请求拦截器
axios.interceptors.request.use(function (config) {
config.headers.Authorization = '111111111'
return config;
}, function (error) {
return Promise.reject(error);
});
// 添加响应拦截器
axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
return Promise.reject(error);
});