axios 在IOS12下的post方法 status 0, response undefind
解决办法
// 安装qs模块
let qs = require("qs");
// 请求拦截器
axios.interceptors.request.use(function (config) {
console.log(config);
if(config.method=='post'){
config.headers['Content-Type'] = "application/x-www-form-urlencoded;charset=utf-8";
config.data = qs.stringify(config.data)
}
config.url = base_url + config.url;
// alert(config.url)
// let token = localstorage.get("token") || "";
// config.headers.authorization = token;
return config;
}, function (error) {
return Promise.reject(error);
});