Open misgaoli opened 3 years ago
hi,版本是:php7.3.5 ,会提示{"errcode":71009,"errmsg":"返回文本非succes},询问钉钉官方,说是不支持7.1+版本 ,验证回调的写法如下,不知道有没有遇到过这个问题
$signature = $_GET["signature"]; $timeStamp = $_GET["timestamp"]; $nonce = $_GET["nonce"]; $postdata = file_get_contents("php://input"); $postList = json_decode($postdata,true); $encrypt = $postList['encrypt']; $crypt = new DingtalkCrypt(TOKEN, ENCODING_AES_KEY, SUITE_KEY); $msg = ""; $res = $crypt->DecryptMsg($signature, $timeStamp, $nonce, $encrypt, $msg); if ($res['ErrorCode'] != 0){//当解密失败记录 Log::e("ErrorCode:" . $res['ErrorCode']); Log::e(json_encode($_GET)); Log::e(json_encode($encrypt)); Log::e('------------------------------------------------------------------------------------------'); }else{ Log::e("SuccessCode:" . $res['ErrorCode']); if(!$res['data']){//当返回值为空记录加密字符串信息 Log::e(json_encode($_GET)); Log::e(json_encode($encrypt)); } Log::e(json_encode($res['data'])); Log::e('------------------------------------------------------------------------------------------'); //创建成功后的回调推送 //$eventMsg = json_decode($res['data']); //$eventType = $eventMsg->EventType; //工作流变动:审批任务开始,结束,转交 //if("bpms_task_change" === $eventType){ //} //工作流变动:审批实例开始,结束 //if("bpms_instance_change" === $eventType){ //} //注册回调接口 回调URL返回值调试 $res = "success"; $encryptMsg = ""; $encryData = $crypt->EncryptMsg($res, $timeStamp, $nonce, $encryptMsg); if($encryData['ErrorCode'] != 0){ Log::e("ERR:" . $encryData); }else{ echo $encryData['data']; } }
这个不是 EasyDingTalk 用法,恐怕无法解答你的问题…
hi,版本是:php7.3.5 ,会提示{"errcode":71009,"errmsg":"返回文本非succes},询问钉钉官方,说是不支持7.1+版本 ,验证回调的写法如下,不知道有没有遇到过这个问题