[图片]这肯定不存在啊 在企业微信里面调动的 而且在源文件中搜索,根本也没有agentConfig
企业微信在H5页面引入weixin-js-sdk . wx.agentConfig 方法不存在。importwxfrom'weixin-js-sdk' exportdefault { data(){ return { } }, created(){ consolelogwx); thisinit(); }, methods: { init(){ letself = this; self$apiget({ sc:"member2" url:`h5/wechat/qy/config/get?url=${windowlocationhref success=> { letresult = result || {}; letappId = resultappId letagentid = resultagentid lettimestamp = resulttimestamp letnonceStr = resultnonceStr letsignature = resultsignature letagentSignature = resultagentSignature wxconfig({ beta:true debug:true appId:appId timestamp:timestamp nonceStr:nonceStr signature:signature jsApiList: [ 'agentConfig', 'getCurExternalContact' ] }) wxreadyfunction () { wxagentConfig({ corpid:appId, // 必填,企业微信的corpid,必须与当前登录的企业一致 agentid:agentid, // 必填,企业微信的应用id timestamp:timestamp, // 必填,生成签名的时间戳 nonceStr:nonceStr, // 必填,生成签名的随机串 signature:agentSignature// 必填,签名,见附录1 jsApiList: ['agentConfig', 'getCurExternalContact'], //必填 successfunctionres) { // 回调 consolelog'success'); wxinvoke'getCurExternalContact', { }, functionres){ consolelog'res'); consolelogres); ifreserr_msg == "getCurExternalContact:ok"){ letuserId = resuserId ; //返回当前外部联系人userId }else { //错误处理 consolelog'error'); } }) }, failfunctionres) { consolelog'fail'); ifreserrMsgindexOf'function not exist') > -){ alert'版本过低请升级' } } }) }) } }) } } }
2020-05-03