1. I set
in main.jsaxios.defaults.withCredentials=true
axios.defaults.crossDomain=true
axios.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded"
when used by other components, once with parameters such as
self.axios.post("http://pj.dianmila.com/supersolid/supersolid_api.php?a=list",{offset:self.swiperlen},{headers: {"Content-Type": "application/x-www-form-urlencoded"}}).then(function(res) {
var datajson = res.data;
..................
}
}
}).catch(function (error) {
alert("")
console.log(error);
});
Why do you ask for advice
if you can"t cross-domain without the following headers setting?2. When I set headers, the passed parameter is {"offset":5}. I want to directly offset:5, like ajax, which is not included in the object, how to implement it, and what configuration options should be added
topic description
sources of topics and their own ideas
related codes
/ / Please paste the code text below (do not replace the code with pictures)