From d2497d51e32485da8a5d3144f91b4aa55bcd4b9e Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 7 Jan 2020 11:22:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=9B=9E=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dingtools/controllers/index.php | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/webht/third_party/dingtools/controllers/index.php b/webht/third_party/dingtools/controllers/index.php index 91ce40ab..44da59df 100644 --- a/webht/third_party/dingtools/controllers/index.php +++ b/webht/third_party/dingtools/controllers/index.php @@ -116,4 +116,27 @@ class index extends CI_Controller { return $departid['0']; } } + + //创建回调 + public function callback(){ + /*$access_url = 'https://oapi.dingtalk.com/gettoken?appkey='.$this->AppKey.'&appsecret='.$this->AppSecret; + $access_token = GetPost_http($access_url,'',''); + $access_token = json_decode($access_token)->access_token;*/ + //ca4f05c2ab663cd2a65f2c50366bf8a9 + $callback_url = 'https://oapi.dingtalk.com/call_back/register_call_back?access_token=ca4f05c2ab663cd2a65f2c50366bf8a9'; + $post_data = array(); + $post_data['call_back_tag'] = ['bpms_task_change','bpms_instance_change']; + $post_data['token'] = '123456'; + $post_data['aes_key'] = 'abcdefgABCDEFG0123456789hHiIjJKkLlMmnNOpQrs'; + $post_data['url'] = 'http://www.mycht.cn/webht.php/apps/dingtools/index/recivecallback'; + + $register = GetPost_http($callback_url,json_encode($post_data),'json'); + print_r($register); + } + + public function recivecallback(){ + echo 'success'; + $recivejson = file_get_contents('php://input'); + log_message('error','dingding回调:'.$recivejson); + } } \ No newline at end of file