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")
}
小程序json字符串转 json对象的方法
最新推荐文章于 2024-04-15 09:54:57 发布