分享到群获取到的信息为空
微信修改分享规则后,分享出的消息,在App的onShow中拿到shareTicket获取到加密信息给后台解密,解密出的信息有小概率为空。
你们有遇到过这种情况吗?
页面:开启了withShareTicket
wx.showShareMenu({ withShareTicket: true }) |
onShareAppMessage: function (res) { return { title: app.$shareConfig.qunText, imageUrl: app.$shareConfig.qunImg, path: `/pages/MailList/qunDetail/qunDetail` } } |
App:
onShow: function (options) { /** * 1044群内分享进入,保存shareTicket */ if (+options.scene === 1044 && options.shareTicket) { this .globalData.share.shareTicket = options.shareTicket } /** * 保存进入场景 */ this .globalData.share.scene = +options.scene }, |
shareTicket获取加密信息:
wx.getShareInfo({ shareTicket: shareTicket, success: res => { let data = { encrypted_data: res.encryptedData, iv: res.iv } app.$http({ url: 'xxxxxx' , params: data, // code ..... }) } }) |