|
|
@ -24,6 +24,7 @@ function filterRequestData(obj) {
|
|
|
|
//创建axios的实例
|
|
|
|
//创建axios的实例
|
|
|
|
const httpService = axios.create({
|
|
|
|
const httpService = axios.create({
|
|
|
|
baseURL: 'http://cloud.sws010.com',// TODO:具体的配置可以根据项目情况而来
|
|
|
|
baseURL: 'http://cloud.sws010.com',// TODO:具体的配置可以根据项目情况而来
|
|
|
|
|
|
|
|
// withCredentials: true
|
|
|
|
// timeout: 5000
|
|
|
|
// timeout: 5000
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
@ -32,7 +33,8 @@ httpService.interceptors.request.use(config => {
|
|
|
|
// 请求成功处理
|
|
|
|
// 请求成功处理
|
|
|
|
// if(localStorage.getItem('token')){//判断浏览器中的cookie中是否存在项目的token
|
|
|
|
// if(localStorage.getItem('token')){//判断浏览器中的cookie中是否存在项目的token
|
|
|
|
// config.headers.token = localStorage.getItem('token')
|
|
|
|
// config.headers.token = localStorage.getItem('token')
|
|
|
|
// }
|
|
|
|
// }\
|
|
|
|
|
|
|
|
config.withCredentials = true;
|
|
|
|
const rqParams = filterRequestData(config.params);
|
|
|
|
const rqParams = filterRequestData(config.params);
|
|
|
|
const rqData = filterRequestData(config.data);
|
|
|
|
const rqData = filterRequestData(config.data);
|
|
|
|
// post 'Content-Type' === 'application/x-www-form-urlencoded'
|
|
|
|
// post 'Content-Type' === 'application/x-www-form-urlencoded'
|
|
|
|