|
@@ -91,9 +91,13 @@ class DingTalkController extends BaseController
|
|
|
|
|
|
// 3. 验证 challenge
|
|
|
if (isset($event['EventType']) && $event['EventType'] === 'check_url') {
|
|
|
- $encryptMsg = '';
|
|
|
- $crypt->encryptMsg($event['Random'], $timestamp, $nonce, $encryptMsg);
|
|
|
- return response()->json($encryptMsg);
|
|
|
+ $encryptMsg = $crypt->encryptMsg($event['Random'], $timestamp, $nonce);
|
|
|
+ return response()->json([
|
|
|
+ "msg_signature" => $encryptMsg['msg_signature'],
|
|
|
+ "timeStamp" => $timestamp,
|
|
|
+ "nonce" => $nonce,
|
|
|
+ "encrypt" => $encryptMsg['encrypt']
|
|
|
+ ]);
|
|
|
}
|
|
|
|
|
|
// 4. 处理事件
|
|
@@ -121,7 +125,11 @@ class DingTalkController extends BaseController
|
|
|
|
|
|
// 5. 返回 success(加密)
|
|
|
$resEncrypt = $crypt->encryptMsg('success', $timestamp, $nonce);
|
|
|
-
|
|
|
- return response()->json($resEncrypt);
|
|
|
+ return response()->json([
|
|
|
+ "msg_signature" => $resEncrypt['msg_signature'],
|
|
|
+ "timeStamp" => $timestamp,
|
|
|
+ "nonce" => $nonce,
|
|
|
+ "encrypt" => $resEncrypt['encrypt']
|
|
|
+ ]);
|
|
|
}
|
|
|
}
|