var that = this;
console.log('start request');
wx.request({
url: 'https://pv.sohu.com/cityjson',
header:{
'content-type': 'json'
},
success: function(res) {
console.log(res);
},
以上代码电脑上出结果,手机上不行
小程序允许域名已设置,手机调试模式也试了
var that = this;
console.log('start request');
wx.request({
url: 'https://pv.sohu.com/cityjson',
header:{
'content-type': 'json'
},
success: function(res) {
console.log(res);
},
以上代码电脑上出结果,手机上不行
小程序允许域名已设置,手机调试模式也试了
5 个回答
楼主怎么解决的,我的也是模拟器数据没问题,真机请求不到数据
非常感谢!!!问题已解决!
现在的小程序满满都是坑啊。
'content-type': 'application/json'不是'content-type': 'json'
真机调试不能勾选那个
这个有没有勾选