Merge pull request 'Content-Type 默认json会触发跨域问题' (#2) from drone into master

Reviewed-on: SWS/carInsightSystem#2
prod
杨赟 3 years ago
commit 3989ff9f31

@ -35,7 +35,9 @@ httpService.interceptors.request.use(config => {
const rqParams = filterRequestData(config.params);
const rqData = filterRequestData(config.data);
// post 'Content-Type' === 'application/x-www-form-urlencoded'
if(config.method === 'post' && config.headers['content-type'] === 'application/x-www-form-urlencoded') {
console.log(config.headers)
config.headers['Content-Type'] = 'application/x-www-form-urlencoded'
if(config.method === 'post') {
config.data = qs.stringify(rqData);
} else {
config.data = rqData;

Loading…
Cancel
Save