wx.config({ debug: false, appId: 'wx5888c314d26f81c3', // 必填,公众号的唯一标识 timestamp: 1795834864, // 必填,生成签名的时间戳 nonceStr: 'McntsEZu0wVmVGJo', // 必填,生成签名的随机串 signature: 'b4a054880d7afa9df8f2ce40d2184f9e402c5b51',// 必填,签名 jsApiList: ["updateTimelineShareData","updateAppMessageShareData"] // 必填,需要使用的JS接口列表 }); wx.ready(function(){ wx.updateTimelineShareData({ title: window.document.title, // 分享标题 link: window.document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: 'https://criaoss.cria.org.cn/res/cria.jpg', // 分享图标 success: function () { // alert('updateTimelineShareData'); } }); wx.updateAppMessageShareData({ title: window.document.title, // 分享标题 desc: window.document.title, // 分享描述 link: window.document.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致 imgUrl: 'https://criaoss.cria.org.cn/res/cria.jpg', // 分享图标 success: function () { // 设置成功 // alert('updateAppMessageShareData'); } }); });