IOS wx.request Bug请求header 设置会丢失?
发布于 4 年前 作者 fanxia 14280 次浏览 来自 问答

getVotes: function() {

var that=this;

wx.request({

url: app.globalData.host + ‘/api/getAllVotes’,

header: app.getToken(),

success: function (res) {

that.data.votes=res.data;

console.log(res)

console.log(res.data)

console.log(that.data.votes)

that.setData({ votes: res.data});

}

})

}

app.getToken()

会返回

{‘X-Auth-Token’: :‘sssss-ssss-ss-sss-s-ss-sss’, ‘X-Requested-With’: ‘XMLHttpRequest’}

android 都是正常得

IOS里面 这个头就会丢失微信都是最新版本

回到顶部