add js
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user