mui.ajax(geolocation, {
data: JSON.stringify(placeIds),
dataType: 'json', //服务器返回json格式数据
type: 'post', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
headers: {
'Content-Type': 'application/json'
},
success: function(data) {
//服务器返回响应,根据响应结果,分析是否登录成功;
console.log(JSON.stringify(data));
},
error: function(xhr, type, errorThrown) {
//异常处理;
console.log(type);
}
});
用其他工具请求一样的接口,提交json可以正常返回结果,但是用mui的post提交就返回error,求解!
0 个回复