From d7db804b89e9964489308fb5a3a8deafcf48f86a Mon Sep 17 00:00:00 2001 From: Anyon Date: Tue, 13 Oct 2020 16:53:36 +0800 Subject: [PATCH] ComposerUpdate --- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- vendor/zoujingli/think-library/src/Library.php | 9 ++++++--- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index c620a57d6..d2b390af2 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -833,12 +833,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "c233ebc4db95c154a297a1ba3b915826937ec2a0" + "reference": "97fc43a5d602d7477c61022003042b1e3535ebce" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c233ebc4db95c154a297a1ba3b915826937ec2a0", - "reference": "c233ebc4db95c154a297a1ba3b915826937ec2a0", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/97fc43a5d602d7477c61022003042b1e3535ebce", + "reference": "97fc43a5d602d7477c61022003042b1e3535ebce", "shasum": "", "mirrors": [ { @@ -855,7 +855,7 @@ "ext-mbstring": "*", "topthink/framework": "^6.0" }, - "time": "2020-10-10T06:38:45+00:00", + "time": "2020-10-13T08:48:27+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 799ca5cc8..bce0c53fe 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/Library.php b/vendor/zoujingli/think-library/src/Library.php index 120a7d468..63269c9bd 100644 --- a/vendor/zoujingli/think-library/src/Library.php +++ b/vendor/zoujingli/think-library/src/Library.php @@ -48,12 +48,15 @@ class Library extends Service */ public function boot() { - // 多应用中间键 + // 多应用中间键处理 $this->app->event->listen('HttpRun', function () { - $this->app->request->baseUrl(); /* 解决 HTTP 调用指令 URL 问题 */ $this->app->middleware->add(App::class); + // 解决 HTTP 模式下调用 Console 之后 URL 生成问题 + if (!$this->app->request->isCli() && !$this->app->config->get('app.url')) { + $this->app->config->set(['url' => $this->app->request->url(true)], 'app'); + } }); - // 替换 ThinkPHP 地址处理 + // 替换 ThinkPHP 地址 $this->app->bind('think\route\Url', Url::class); // 替换 ThinkPHP 指令 $this->commands(['build' => Build::class, 'clear' => Clear::class]);