1、效果展示
2、操作步骤
1)调用【显示当前页面的转发按钮】API 并设置参数withShareTicket为true
wx.showShareMenu({
withShareTicket:true
})
2)在页面转发函数【onShareAppMessage 】中使用【获取转发详细信息】API获取加密数据encryptedData和加密算法iv
wx.getShareInfo({
shareTicket: res.shareTickets[0],
success: function (res) {
console.log(res.encryptedData)
console.log(res.iv)
}
})
3)调用登录接口获取用户登录的code
wx.login({
success:function(res){
console.log(res.code)
}
})
4)加密数据解密,参考 https://mp.weixin.qq.com/debug/wxadoc/dev/api/signature.html