1 回复
小程序
wx.request({
url: ‘https://pv.sohu.com/cityjson?ie=utf-8’,
success(res){
var m = JSON.parse(res.data.match(/.*(\{[^\}]+\}).*/)[1] || ‘{}’)
console.log(‘ip =>’, m.cip, m)
}
})
wx.request({
url: ‘http://ip-api.com/json’,
success: function (res) {
console.log(“ip =>”, res.data.query, res.data);
}
})