success: function (res) {
console.log(res.data)
var jsonStr= res.data;
jsonStr = jsonStr.replace(" ","");
if(typeof jsonStr!= 'object'){
jsonStr= jsonStr.replace(/\ufeff/g,"");//重点
var jj = JSON.parse(jsonStr);
res.data = jj;
}
if (res.data.status==1){
console.log("ok")
}
注:如果原本用jsonp传输的,小程序开发的时候需要先转为json的,可以用substr方法