From 5e2b3a20b989eaca5cc4465204df1c01714bf2d3 Mon Sep 17 00:00:00 2001 From: lulu <794329728@qq.com> Date: Tue, 17 Aug 2021 10:33:05 +0800 Subject: [PATCH 1/2] fix bug --- src/plugin/Notice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugin/Notice.php b/src/plugin/Notice.php index b6392a1..489778a 100644 --- a/src/plugin/Notice.php +++ b/src/plugin/Notice.php @@ -192,7 +192,7 @@ class Notice 'msgtype' => 'markdown', 'markdown' => [ 'title' => $info['title'], - 'content' => $info['content'], + 'text' => $info['content'], ] ]; $headers = [ From 7bfde9acadf89d4f48093aa5f2f1b5090f8a0b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8F=9C=E7=8B=97?= <794329728@qq.com> Date: Thu, 19 Aug 2021 10:20:45 +0800 Subject: [PATCH 2/2] =?UTF-8?q?[add]=20=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=8F=82=E6=95=B0=E5=90=AF=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 11 +++++++++++ src/core/App.php | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index dd2a4b3..c7b3e5a 100644 --- a/index.php +++ b/index.php @@ -11,6 +11,17 @@ require 'vendor/autoload.php'; + +if ($argc >= 3) { + if ($argv[2] == 'script') { + define('__MODE__', 2); + } +} +if (!defined('__MODE__')) { + define('__MODE__', 1); +} + + $app = new BiliHelper\Core\App(__DIR__); $app->load($argv) ->inspect() diff --git a/src/core/App.php b/src/core/App.php index 092173a..3c689ec 100644 --- a/src/core/App.php +++ b/src/core/App.php @@ -62,7 +62,7 @@ class App */ public function newTask(string $taskName, string $dir) { - asyncCall(function () use ($taskName, $dir) { + asyncCall(function() use ($taskName, $dir) { while (true) { try { call_user_func(array("BiliHelper\\$dir\\" . $taskName, 'run'), []); @@ -148,7 +148,7 @@ class App public function start() { // Todo 模式名称需要优化 - if ($this->script_mode) { + if (__MODE__ == 2) { Log::info('执行Script模式'); $this->script_m(); } else {