wx.config({
beta: true,
debug: true,
appId: data.corpId,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.configsign,
jsApiList: ['agentConfig']
});
wx.error(function(res) {
alert('应用内部异常: ' + JSON.stringify(res));
});
wx.ready(function(){
wx.agentConfig({
corpid: data.corpId,
agentid: data.agentId,
timestamp: data.timestamp,
nonceStr: data.noncestr,
signature: data.agentsign,
jsApiList: ['thirdPartyOpenPage'],
success: function(res) {
let applyData = {
"oaType": "10001",
"templateId": templateId,
"thirdNo": data.approvalNum,
"extData": {
'fieldList': [{
'title': '申请原因',
'type': 'text',
'value': apply,
},{
'title': '权限名称',
'type': 'text',
'value': options,
}],
}
};
wx.invoke('thirdPartyOpenPage', applyData, function (res) {
if (res.err_msg.indexOf('ok') > 0) {
let body = {
'_token': '{{ csrf_token() }}',
'gid': gid,
'tag': tag,
'apply': apply,
'templateId': templateId,
'thirdNo': data.approvalNum,
'options': $("#select option:selected").text()
};
$.post('/check/add', body, function (resp) {});
} else {
alert("应用内部错误: " + JSON.stringify(res));
}
});
},
fail: function(res) {
alert('应用配置异常: '+ JSON.stringify(res))
}
});
});
你好,checkJsApi 打印thirdPartyOpenPage 接口是否ok,发起审批失败是否有什么报错
wx.invoke('thirdPartyOpenPage', applyData, function (res) {