var verifyCode = url.verifyCode(); //接口
mui.ajax(verifyCode, {
dataType: 'json', //服务器返回json格式数据
type: 'get', //HTTP请求类型
timeout: 10000, //超时时间设置为10秒;
headers: {
// 'Content-Type': 'application/json',
},
success: function (result,status,xhr) {
console.log(JSON.stringify(xhr.getResponseHeader('key')))
key = xhr.getResponseHeader('key') //获取响应头中的key值
},
error: function (xhr, type, errorThrown) {
//异常处理;
console.log(JSON.stringify(type))
}
});
移动应用app在apicloud中使用mui中的ajax获取响应头中的数据方法
最新推荐文章于 2023-04-19 17:34:16 发布