[fix] some bug

This commit is contained in:
Lkeme 2023-05-09 15:00:50 +08:00
parent 96db883319
commit 5ed2d9ff12
3 changed files with 11 additions and 15 deletions

View File

@ -47,7 +47,7 @@
"amphp/amp": "3.x-dev", "amphp/amp": "3.x-dev",
"fire015/flintstone": "dev-master", "fire015/flintstone": "dev-master",
"overtrue/pinyin": "dev-master", "overtrue/pinyin": "dev-master",
"guzzlehttp/guzzle": "dev-master", "guzzlehttp/guzzle": "^7.0",
"toolkit/pflag": "dev-main", "toolkit/pflag": "dev-main",
"symfony/console": "^6.0", "symfony/console": "^6.0",
"malios/php-to-ascii-table": "dev-master" "malios/php-to-ascii-table": "dev-master"

View File

@ -183,7 +183,7 @@ class Lottery extends BasePlugin
$response = Request::getJson(true, 'pc', $url, $payload); $response = Request::getJson(true, 'pc', $url, $payload);
// 抽奖不存在 // 抽奖不存在
if ($response['code'] === -9999) { if ($response['code'] === -9999 || $response['code'] === 4000014) {
return [ return [
'status' => -9999, 'status' => -9999,
]; ];

View File

@ -485,20 +485,16 @@ class Notice extends SingleTon
protected function bark(array $info): void protected function bark(array $info): void
{ {
Log::info('使用bark推送消息'); Log::info('使用bark推送消息');
$url = 'https://api.day.app/' . getConf('notify_bark.token'); // 转url编码
$info['title'] = urlencode($info['title']);
$payload = [ $info['content'] = urlencode($info['content']);
'msgtype' => 'markdown', //
'markdown' => [ $url = 'https://api.day.app/' . getConf('notify_bark.token') . "/{$info['title']}/{$info['content']}";
'content' => "{$info['title']} \n\n{$info['content']}" $de_raw = Request::getJson(true, 'other', $url, [], []);
] if ($de_raw['code'] === 200) {
]; Log::notice("推送消息成功: {$de_raw['message']}");
$raw = Request::put('other', $url, $payload, $this->headers);
$de_raw = json_decode($raw, true);
if ($de_raw['message'] == 'success') {
Log::notice("推送消息成功: {$de_raw['errmsg']}");
} else { } else {
Log::warning("推送消息失败: $raw"); Log::warning('推送消息失败: ' . json_encode($de_raw));
} }
} }