From 515519c5cf1a38bfc34b7b375b70b17e624eaa44 Mon Sep 17 00:00:00 2001 From: DishesDog <794329728@qq.com> Date: Thu, 27 Jan 2022 18:06:10 +0800 Subject: [PATCH 1/4] =?UTF-8?q?[add]=20=E6=B7=BB=E5=8A=A0=E9=A3=9E?= =?UTF-8?q?=E4=B9=A6=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin/Notice.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/plugin/Notice.php b/src/plugin/Notice.php index 4c60b1a..33858e1 100644 --- a/src/plugin/Notice.php +++ b/src/plugin/Notice.php @@ -167,6 +167,9 @@ class Notice if (getConf('corp_id', 'notify.we_com_app') && getConf('corp_secret', 'notify.we_com_app') && getConf('agent_id', 'notify.we_com_app')) { self::weComApp($info); } + if (getConf('token', 'notify.feishu')) { + self::feiShuSend($info); + } } /** @@ -415,4 +418,32 @@ class Notice } } + + /** + * @use 飞书推送 + * @doc https://developers.dingtalk.com/document/robots/custom-robot-access + * @param array $info + */ + private static function feiShuSend(array $info) + { + Log::info('使用飞书webhook机器人推送消息'); + $url = 'https://open.feishu.cn/open-apis/bot/v2/hook/' . getConf('token', 'notify.feishu'); + $payload = [ + 'msg_type' => 'text', + 'content' => [ + 'text' => $info['title'] . $info['content'], + ] + ]; + $headers = [ + 'Content-Type' => 'application/json;charset=utf-8' + ]; + $raw = Curl::put('other', $url, $payload, $headers); + $de_raw = json_decode($raw, true); + if ($de_raw['StatusCode'] == 0) { + Log::notice("推送消息成功: {$de_raw['StatusCode']}"); + } else { + Log::warning("推送消息失败: $raw"); + } + } + } \ No newline at end of file From 6333b8735744a4dde281fa25438565b02546229e Mon Sep 17 00:00:00 2001 From: DishesDog <794329728@qq.com> Date: Thu, 27 Jan 2022 18:06:52 +0800 Subject: [PATCH 2/4] =?UTF-8?q?[add]=20=E6=B7=BB=E5=8A=A0=E9=A3=9E?= =?UTF-8?q?=E4=B9=A6=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/user.ini.example | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/user.ini.example b/conf/user.ini.example index 2504a6e..7725a0e 100644 --- a/conf/user.ini.example +++ b/conf/user.ini.example @@ -209,6 +209,10 @@ url = "" token = target_qq = +; 飞书机器人|依赖USE_NOTIFY +[notify.feishu] +token = 15a2bc73-a1da-4152-a08d-0870e938f97f + ; Debug|个人调试推送|url|token [notify.debug] url = "" From a894b1f3b795ead6c24991cefe5e2fddbd1a1336 Mon Sep 17 00:00:00 2001 From: DishesDog <794329728@qq.com> Date: Thu, 27 Jan 2022 18:07:07 +0800 Subject: [PATCH 3/4] =?UTF-8?q?[add]=20=E6=B7=BB=E5=8A=A0=E9=A3=9E?= =?UTF-8?q?=E4=B9=A6=E6=8E=A8=E9=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- conf/user.ini.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/user.ini.example b/conf/user.ini.example index 7725a0e..61262d5 100644 --- a/conf/user.ini.example +++ b/conf/user.ini.example @@ -211,7 +211,7 @@ target_qq = ; 飞书机器人|依赖USE_NOTIFY [notify.feishu] -token = 15a2bc73-a1da-4152-a08d-0870e938f97f +token = ; Debug|个人调试推送|url|token [notify.debug] From 8b74828b947547664058792ab4148bead59d2ca0 Mon Sep 17 00:00:00 2001 From: 403 Forbidden Date: Sat, 29 Jan 2022 17:27:19 +0800 Subject: [PATCH 4/4] =?UTF-8?q?[fix]=20Cli=20=E6=A8=A1=E5=BC=8F=E4=B8=8B?= =?UTF-8?q?=E6=97=A0=E9=9C=80=E5=8F=91=E9=80=81=20header?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/Env.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/Env.php b/src/core/Env.php index e6bf433..27d35c8 100644 --- a/src/core/Env.php +++ b/src/core/Env.php @@ -28,7 +28,7 @@ class Env public function __construct() { set_time_limit(0); - header("Content-Type:text/html; charset=utf-8"); + // header("Content-Type:text/html; charset=utf-8"); // ini_set('date.timezone', 'Asia/Shanghai'); date_default_timezone_set('Asia/Shanghai'); ini_set('display_errors', 'on');