wx.config({ //debug: true, appId: 'wx7f154fcb4aa227df', timestamp: '1716491347', nonceStr: 'XF4xQ6gK9pMGOzqZ', signature: '78cdd1c5e81b53c1568a1fae2feefe7f237c3924', jsApiList: ["updateAppMessageShareData","updateTimelineShareData"] }); wx.ready(function () { //需在用户可能点击分享按钮前就先调用 var imgurl = 'https://www.dww11.com/data/attachment/forum/202311/28/736b8d384b07b4e2a2d44e8882298494.jpeg'; var title = document.title; var desc = document.getElementsByName("description")[0].content; var link = ''; wx.updateAppMessageShareData({ title: title, // 分享标题 desc: desc, // 分享描述 link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: imgurl, // 分享图标 success: function () { // 设置成功 } }) wx.updateTimelineShareData({ title: title, // 分享标题 link: link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: imgurl, // 分享图标 success: function () { // 设置成功 } }) });