Merge branch 'fix_feishu_webhook' into 'master'

* Fix feishu webhook missing msg_type when no secret.

See merge request easycorp/zentaopms!6623
This commit is contained in:
朱金勇
2022-12-29 06:42:49 +00:00
+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);
}