发布的小程序获取不到openid

发布于 7 年前作者 xiulanshen999 次浏览最后编辑 7 年前来自 ask

在开发这工具和真机调试情况下都好用,发布后就获取不到什么原因呢

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 回复
uxiong
uxiong1 楼6 年前

已解决,放到后台处理就好用了

luming
luming2 楼6 年前

用云开发获得openid吧,几分钟前刚写的openid的处理方式:仅供参考。

https://developers.weixin.qq.com/community/develop/doc/0008089ec2c6200b81e76e6ac56804

hshi
hshi3 楼5 年前

看看后台获取openid 有什么错误信息