发布的小程序获取不到openid
发布于 5 年前 作者 xiulanshen 824 次浏览 来自 问答

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

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

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

回到顶部