企业微信中自建应用发起审批怎么实现
wx.config ()和wx.wx.agentConfig()都已返回 ok 说明注入权限应该是成功了,为什么wx.invoke('thirdPartyOpenPage“)似乎没有执行,也没有返回错误,请教。还有wx.agentConfig虽然返回 ok 但是在开发者工具总提示“TypeError: wx.agentConfig is not a function”
wx.ready(function(){
wx.agentConfig({
corpid: '<%= AppID %>',
agentid: '1000005',
timestamp: <%=timestamp%>,
nonceStr: '<%=noncestr%>',
signature: '<%=signature2%>',
jsApiList: [
'thirdPartyOpenPage',
'selectExternalContact'
],
success: function(res) {
alert("wx.agentconfig ok");
},
fail: function(res) {
alert("wx.agentconfig error:" + res.errMsg);
}
});
wx.invoke('thirdPartyOpenPage', {
"oaType": "10001",
"templateId": "04174d8c4076102ba1cd65c27d0ffc4d_2129213612",
"thirdNo": "A201902011001",
"extData": {
'fieldList': [{
'title': '采购类型',
'type': 'text',
'value': '市场活动',
},
{
'title': '订单链接',
'type': 'link',
'value': 'https://work.weixin.qq.com',
}],
}
},
function(res) {
alert(JSON.stringify(res));
console.log(res);
});
});