diff --git a/docs/NOTIFY.md b/docs/NOTIFY.md index 8e2fe31..b00ed3b 100644 --- a/docs/NOTIFY.md +++ b/docs/NOTIFY.md @@ -147,6 +147,18 @@ token = token = ``` +**PushDeer** + +> 文档: http://pushdeer.com/ +> 说明: 服务器地址,Token + +```ini +; PushDeer/服务器地址/token +[notify_push_deer] +url = +token = +``` + ### 调试 https://github.com/lkeme/BiliHelper-personal/blob/eb06f55fa0fa6cb07bbeffc7e85c6ac0bfaa67b3/data/latest_version.json#L8 diff --git a/src/Notice/Notice.php b/src/Notice/Notice.php index 773c475..9e79dda 100644 --- a/src/Notice/Notice.php +++ b/src/Notice/Notice.php @@ -502,12 +502,18 @@ class Notice extends SingleTon } } + /** + * PushDeer 推送 + * @doc http://pushdeer.com/ + * @param array $info + * @return void + */ protected function pushDeer(array $info) { Log::info('使用 PushDeer 推送消息'); $token = getConf('notify_push_deer.token'); $url = getConf('notify_push_deer.url'); - if (!str_contains($url, "http")){ + if (!str_contains($url, "http")) { $url = "https://api2.pushdeer.com/message/push"; } @@ -521,7 +527,7 @@ class Notice extends SingleTon 'Content-Type' => 'application/x-www-form-urlencoded' ]); $de_raw = json_decode($raw, true); - if ($de_raw['code'] == 0){ + if ($de_raw['code'] == 0) { Log::notice("推送消息成功: {$de_raw['content']['result'][0]}"); } else { Log::warning("推送消息失败: $raw");