* Fix feishu webhook missing msg_type when no secret.

This commit is contained in:
Lufei
2022-12-23 11:30:43 +08:00
parent a65844d582
commit 7623eacfe5
+4 -6
View File
@@ -453,7 +453,7 @@ class webhookModel extends model
{
$data = $this->getWeixinData($title, $text, $mobile);
}
elseif($webhook->type == 'feishuuser')
elseif($webhook->type == 'feishuuser' or $webhook->type == 'feishugroup')
{
$data = $this->getFeishuData($title, $text);
}
@@ -705,11 +705,9 @@ class webhookModel extends model
$sign = $timestamp . "\n" . $webhook->secret;
$sign = base64_encode(hash_hmac('sha256', '', $sign, true));
$content = array();
$content['timestamp'] = $timestamp;
$content['sign'] = $sign;
$content['msg_type'] = 'text';
$content['content'] = json_decode($sendData);
$content = json_decode($sendData);
$content->timestamp = $timestamp;
$content->sign = $sign;
$sendData = json_encode($content);
}