getAppJSApi({ url: location.href, userId: this.userId }).then(res => {
wx.config({
beta: true,
debug: false,
appId: res.result.appId,
timestamp: res.result.timestamp,
nonceStr: res.result.noncestr,
signature: res.result.cropSignature,
jsApiList: ['getContext', 'sendChatMessage', 'getCurExternalContact', 'onMenuShareAppMessage', 'shareAppMessage', 'hideOptionMenu', 'hideMenuItems']
});
wx.ready(function () {
wx.hideOptionMenu();
wx.hideMenuItems({
menuList: ['menuItem:share:appMessage','menuItem:share:wechat','menuItem:favorite','menuItem:copyUrl','menuItem:openWithSafari','menuItem:share:email']
});
wx.agentConfig({
corpid: res.result.corpid,
agentid: res.result.agentid,
timestamp: res.result.timestamp,
nonceStr: res.result.noncestr,
signature: res.result.appSignature,
jsApiList: ['getContext', 'sendChatMessage', 'getCurExternalContact', 'onMenuShareAppMessage', 'shareAppMessage', 'hideOptionMenu', 'hideMenuItems'],
wx.hideOptionMenu();
wx.hideMenuItems({
menuList: ['menuItem:share:appMessage','menuItem:share:wechat','menuItem:favorite','menuItem:copyUrl','menuItem:openWithSafari','menuItem:share:email']
});
},
fail: function (res) {
_this.loading.close();
if (res.errMsg.indexOf('function not exist') > -1) {
alert('版本过低请升级')
}
}
});
});
})
桌面端右上角的复制链接、在浏览器中打开隐藏不掉,手机端右上角菜单能正常被隐藏掉
在桌面端通过控制台查看,隐藏菜单接口及批量隐藏按钮接口都正常被调用了
桌面端企业微信版本号:4.1.2.6017
微信js:
<script src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js" referrerpolicy="origin"></script>
<script src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js" referrerpolicy="origin"></script>