收藏
回答

Mac中调用wx.agentConfig报错,返回agentConfig:fail_invalid?

api.workwechatGetSignatureConfig({corpId:params.corpId,url:params.url,type:1}).then(res => { 
      wx.agentConfig({
        corpid: params.corpId, // 必填,企业微信的corpid,必须与当前登录的企业一致
        agentid: params.agentId, // 必填,企业微信的应用id (e.g. 1000247)
        timestamp: res.data.timestamp, // 必填,生成签名的时间戳
        nonceStr: res.data.noncestr, // 必填,生成签名的随机串
        signature: res.data.signature,// 必填,签名,见附录-JS-SDK使用权限签名算法
        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}) }
        }
      });
    }) 
回答关注问题邀请回答
收藏
登录 后发表内容