axios配置允许跨域
2019-09-27 本文已影响0人
爱代码的派派星
import axios from 'axios';
axios.defaults.withCredentials=true
axios.defaults.crossDomain=true
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'
// 正式环境接口转向
// axios.defaults.baseURL = '//aaa.eos.dev.enbrands.com';
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
// axios.defaults.headers.get['Content-Type'] = 'application/x-www-form-urlencoded';