function webchatShare() {
wx.config({
debug: true,
appId:固定值,
timestamp:固定值 ,
nonceStr: 固定值,
signature: 固定值,
jsApiList: [
"onMenuShareTimeline",
"onMenuShareAppMessage",
"updateAppMessageShareData",
"updateTimelineShareData"
]
});
wx.ready(function () {
console.log('wx ready')
const shareObject = {
title:'111',
desc:'111',
link:'https://www.baidu.com',
success:function(){
console.log('success')
},
cancel:function(){
console.log('cancel')
},
fail:function(){
console.log('fail')
}
}
wx.updateAppMessageShareData(shareObject);
});
https:
你的步骤好像有问题。
timestamp、nonceStr、signature
这几个数据需要通过鉴权操作拿到,具体过程参考权限签名算法文档
https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#62