From 73a554defadeb6cff3d773b6210e098b5c18b8b6 Mon Sep 17 00:00:00 2001 From: cyc Date: Tue, 7 Jan 2020 15:58:02 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A5=E6=94=B6=E5=9B=9E?= =?UTF-8?q?=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dingtools/controllers/index.php | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/webht/third_party/dingtools/controllers/index.php b/webht/third_party/dingtools/controllers/index.php index 44da59df..103c6de4 100644 --- a/webht/third_party/dingtools/controllers/index.php +++ b/webht/third_party/dingtools/controllers/index.php @@ -119,11 +119,11 @@ class index extends CI_Controller { //创建回调 public function callback(){ - /*$access_url = 'https://oapi.dingtalk.com/gettoken?appkey='.$this->AppKey.'&appsecret='.$this->AppSecret; + $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;*/ + $access_token = json_decode($access_token)->access_token; //ca4f05c2ab663cd2a65f2c50366bf8a9 - $callback_url = 'https://oapi.dingtalk.com/call_back/register_call_back?access_token=ca4f05c2ab663cd2a65f2c50366bf8a9'; + $callback_url = 'https://oapi.dingtalk.com/call_back/register_call_back?access_token='.$access_token; $post_data = array(); $post_data['call_back_tag'] = ['bpms_task_change','bpms_instance_change']; $post_data['token'] = '123456'; @@ -134,9 +134,15 @@ class index extends CI_Controller { print_r($register); } - public function recivecallback(){ - echo 'success'; - $recivejson = file_get_contents('php://input'); - log_message('error','dingding回调:'.$recivejson); + public function recivecallback(){ + $recivejson = file_get_contents('php://input'); + $encrypt = json_decode($recivejson)->encrypt; + echo '{ + "msg_signature":"", + "timeStamp":"'.time().'", + "nonce":"123456", + "encrypt":"'.$encrypt.'" + }'; + log_message('error','dingding回调:'.$recivejson); } } \ No newline at end of file