api.workwechatGetSignatureConfig({corpId:params.corpId,url:params.url,type:1}).then(res => {
wx.agentConfig({
corpid: params.corpId,
agentid: params.agentId,
timestamp: res.data.timestamp,
nonceStr: res.data.noncestr,
signature: res.data.signature,
jsApiList: ['selectExternalContact'],
success: function(res) {
window.WWOpenData.bind(document.querySelector('ww-open-data'))
if (agentConfigCallBack) { agentConfigCallBack({code:1}) }
console.log('绑定开放数据成功:',res)
},
fail: function(res) {
console.log('绑定开放数据失败:',res)
if(res.errMsg.indexOf('function not exist') > -1){
alert('版本过低请升级')
}
if (agentConfigCallBack) { agentConfigCallBack({code:-1}) }
}
});
})