Problems with using axios

problem solved my configuration is correct, just because the previous parameter format is request payload, parameter format is json, instead of using form parameter format, so in the background to receive form data to receive parameters can not be received.
solution:
install qs: npm install qs-- save
configure it globally

axios.defaults.headers.post ["Content-Type"] =" application/x-www-form-urlencoded;charset=UTF-8";
import qs from "qs";
axios.defaults.transformRequest = [function (data) {
return qs.stringify (data)
}];

is fine

Feb.26,2021

http://116.62.208.141:8181/ljb-user/userInfo/h5/home/getBannerList this is the address you requested to see if it is correct

Menu