问题模块 |
---|
API和组件 |
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);
},
以上代码电脑上出结果,手机上不行
小程序允许域名已设置,手机调试模式也试了
网友回复
简:
楼主怎么解决的,我的也是模拟器数据没问题,真机请求不到数据
Garrett:
非常感谢!!!问题已解决!
现在的小程序满满都是坑啊。
Vinlic:
'content-type': 'application/json'不是'content-type': 'json'
GG:
真机调试不能勾选那个
GG:
这个有没有勾选