发布的小程序获取不到openid
在开发这工具和真机调试情况下都好用,发布后就获取不到什么原因呢
onLaunch: function () {
var that = this;
wx.login({
success: res => {
wx.request({
url: that.globalData.wx_url_1 + res.code + that.globalData.wx_url_2,
success: res => {
wx.getUserInfo({
success: function (res) {
…
}
});
that.globalData.openid = res.data.openid;
}
})
}
});
3 回复
用云开发获得openid吧,几分钟前刚写的openid的处理方式:仅供参考。
https://developers.weixin.qq.com/community/develop/doc/0008089ec2c6200b81e76e6ac56804