b***@126.com
b***@126.com
  • 发布:2018-08-20 18:10
  • 更新:2018-08-20 18:10
  • 阅读:2076

MUI.ajax 用 GET方法带headers参数提交报错,postman测试是成功

分类:MUI

mui.plusReady(function() {

    mui.ajax('http://www.jrcs.com/api/v1/index',{     

headers: {
sign:'ff',
app_type:'ios'
},
dataType:'json',//服务器返回json格式数据
type:'GET',//HTTP请求类型
timeout:10000,//超时时间设置为10秒;
headers:{'Content-Type':'application/json'},
success:function(data){
//console.log(data.stories[0].images);
//获取数据
//console.log(data.data.heads[0].id);
console(data);
//var html=template('list',data);
//console.log(html)
//document.getElementById("news").innerHTML=html;
},
error:function(xhr,type,errorThrown){
//异常处理;
console.log(type);
console.log(errorThrown);

}  

});
})
。报错如下:
28 KB/s (4054 bytes in 0.137s)
文件/tpl/index.html同步完成...
error at tpl/index.html:108
Forbidden at tpl/index.html:109
,就是到异常了

2018-08-20 18:10 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复