微信开发1.4.0分享接口报错 [也有可能是5呢。]+ 查看更多
微信开发1.4.0分享接口报错 [也有可能是5呢。]
+ 查看更多
项目引用jweixin-1.4.0.js做分享,但是报错
{"errMsg":"updateAppMessageShareData:没有此SDK或暂不支持此SDK模拟"}
const wx = require( './jweixin-1.4.0.js' );
// 分享配置 const share = { title: "标题" ,
desc: "描述" ,
link: "链接" ,
imgUrl: "图片"
}; // 微信鉴权设置 const wxOpt = { userid: "" ,
debug: 1,
appId: "" ,
timestamp: "" ,
noncestr: "" ,
signature: "" ,
apis: [
"hideMenuItems" , "showMenuItems" , "hideAllNonBaseMenuItem" , "showAllNonBaseMenuItem" ,
"translateVoice" , "startRecord" , "stopRecord" , "onRecordEnd" , "playVoice" , "pauseVoice" ,
"stopVoice" , "uploadVoice" , "downloadVoice" , "chooseImage" , "previewImage" , "uploadImage" ,
"downloadImage" , "getNetworkType" , "openLocation" , "getLocation" , "hideOptionMenu" , "showOptionMenu" ,
"closeWindow" , "scanQRCode" , "chooseWXPay" , "openProductSpecificView" , "addCard" , "chooseCard" , "openCard" ,
"onMenuShareTimeline" , "onMenuShareAppMessage" , "updateAppMessageShareData" , "updateTimelineShareData"
]
}; export default {
init() {
wx.config({
debug: wxOpt.debug,
appId: wxOpt.appId,
timestamp: wxOpt.timestamp,
nonceStr: wxOpt.noncestr,
signature: wxOpt.signature,
jsApiList: wxOpt.apis
})
},
getWxConfig() {
$.ajax({
url: "" ,
type: "POST" ,
data: {
hash: 'less' ,
url: window.location.href.split( "#" )[0]
},
async: !1,
dataType: "json" ,
success(e) {
$.extend(wxOpt, e.data);
}
})
},
Handler() {
this .getWxConfig();
this .init();
wx.ready( function () {
wx.hideMenuItems({
menuList: [ "menuItem:share:weiboApp" , "menuItem:share:facebook" , "menuItem:openWithQQBrowser" , "menuItem:openWithSafari" , "menuItem:share:email" , "menuItem:share:qq" , "menuItem:share:weiboApp" , "menuItem:share:QZone" ]
});
wx.updateTimelineShareData({
title: share.title,
imgUrl: share.imgUrl,
link: share.link,
success: function () {
}
});
wx.updateAppMessageShareData({
title: share.title,
desc: share.desc,
imgUrl: share.imgUrl,
link: share.link,
success: function () {
}
});
wx.onMenuShareTimeline({ //(即将废弃)
title: share.title, // 分享标题
link: share.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: share.imgUrl, // 分享图标
success: function () {
// 用户点击了分享后执行的回调函数
},});
wx.onMenuShareAppMessage({ //(即将废弃)
title: share.title, // 分享标题
desc: share.desc, // 分享描述
link: share.link, // 分享链接,该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
imgUrl: share.imgUrl, // 分享图标
type: 'link' , // 分享类型,music、video或link,不填默认为link
dataUrl: '' , // 如果type是music或video,则要提供数据链接,默认为空
success: function () {
// 用户点击了分享后执行的回调函数 }
});
})
},
}; |
微信打印也显示权限获取到了,但是还是报这个错误
jsapi也已经拿到了,请问有人出现过这个错误吗,有没有什么解决方案呢
-
, 如果你什么都不说,我也不知道怎么回答你呀开发者工具上好像不支持最新的分享接口, 如果可以送我一个工具我会很高兴哦。, 如果你什么都不说,我也不知道怎么回答你呀