设置不校检域名后,开发版可以获取到数据,体验版不可以。如何设置合法域名啊?
onLoad: function (options) {
var that=this;
const _ = db.command
//获取当前用户id开始
wx.login({
success(res) {
wx.request({
url: ‘https://api.weixin.qq.com/sns/jscode2session’,
data: {
appid: ‘*************’,
secret: ‘******************’,
js_code: res.code,
grant_type: ‘authorization_code’
},
method: “GET”,
success: function (res) {
console.log(res.data)
that.setData({
YHid: res.data.openid
})
that.jiansuo()
}
})
}
})
//获取当前用户id结束
},
//检索 根据用户id
jiansuo:function(){
console.log(“111:”+this.data.YHid)
ordersColle.where({
userid: db.RegExp({
regexp: this.data.YHid
})
}).get().then(res => {
this.setData({
order_2: res.data
})
})
}