From 96f54f8d5ea6765c75a9fa8ed40e069adb62071a Mon Sep 17 00:00:00 2001 From: Anyon Date: Thu, 30 Jul 2020 19:00:36 +0800 Subject: [PATCH] ComposerUpdate --- app/admin/view/config/storage-local.html | 10 ++++++++++ composer.lock | 8 ++++---- vendor/composer/installed.json | 8 ++++---- vendor/services.php | 2 +- .../think-library/src/storage/AliossStorage.php | 2 +- .../think-library/src/storage/LocalStorage.php | 14 +++++--------- .../think-library/src/storage/QiniuStorage.php | 2 +- 7 files changed, 26 insertions(+), 20 deletions(-) diff --git a/app/admin/view/config/storage-local.html b/app/admin/view/config/storage-local.html index bff8f1000..32a7f75cc 100644 --- a/app/admin/view/config/storage-local.html +++ b/app/admin/view/config/storage-local.html @@ -26,6 +26,16 @@ +
+ +
+ +

填写上传后的访问域名(不指定时根据当前访问地址自动计算),如:static.ctolog.com

+
+
+
diff --git a/composer.lock b/composer.lock index 886b63079..53458c97f 100644 --- a/composer.lock +++ b/composer.lock @@ -879,12 +879,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "c5ae2601c499d95776061aeda087478f7912c2c5" + "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5ae2601c499d95776061aeda087478f7912c2c5", - "reference": "c5ae2601c499d95776061aeda087478f7912c2c5", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f", + "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f", "shasum": "", "mirrors": [ { @@ -928,7 +928,7 @@ ], "description": "ThinkPHP v6.0 Development Library", "homepage": "http://framework.thinkadmin.top", - "time": "2020-07-30T09:50:41+00:00" + "time": "2020-07-30T10:54:48+00:00" }, { "name": "zoujingli/wechat-developer", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 6bdff1f85..acf083ffe 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -903,12 +903,12 @@ "source": { "type": "git", "url": "https://github.com/zoujingli/ThinkLibrary.git", - "reference": "c5ae2601c499d95776061aeda087478f7912c2c5" + "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5ae2601c499d95776061aeda087478f7912c2c5", - "reference": "c5ae2601c499d95776061aeda087478f7912c2c5", + "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f", + "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f", "shasum": "", "mirrors": [ { @@ -924,7 +924,7 @@ "ext-json": "*", "topthink/framework": "^6.0" }, - "time": "2020-07-30T09:50:41+00:00", + "time": "2020-07-30T10:54:48+00:00", "type": "library", "extra": { "think": { diff --git a/vendor/services.php b/vendor/services.php index 30b1aac22..c91bcd537 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'think\\admin\\Library', diff --git a/vendor/zoujingli/think-library/src/storage/AliossStorage.php b/vendor/zoujingli/think-library/src/storage/AliossStorage.php index dcf2ffaba..9f5b6ab88 100644 --- a/vendor/zoujingli/think-library/src/storage/AliossStorage.php +++ b/vendor/zoujingli/think-library/src/storage/AliossStorage.php @@ -51,7 +51,7 @@ class AliossStorage extends Storage /** * 初始化入口 - * @return Storage + * @return static * @throws \think\admin\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException diff --git a/vendor/zoujingli/think-library/src/storage/LocalStorage.php b/vendor/zoujingli/think-library/src/storage/LocalStorage.php index dd2a03a4a..0a436bfea 100644 --- a/vendor/zoujingli/think-library/src/storage/LocalStorage.php +++ b/vendor/zoujingli/think-library/src/storage/LocalStorage.php @@ -27,26 +27,22 @@ class LocalStorage extends Storage /** * 初始化入口 - * @return Storage + * @return static * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ protected function initialize() { - // 计算链接前缀 $type = strtolower(sysconf('storage.local_http_protocol')); - if ($type === 'path') { - $file = $this->app->request->baseFile(false); - $this->prefix = trim(dirname($file), '\\/'); - } else { - $this->prefix = dirname($this->app->request->basefile(true)); - list(, $domain) = explode('://', strtr($this->prefix, '\\', '/')); + if ($type === 'follow') $type = $this->app->request->scheme(); + $this->prefix = trim(dirname($this->app->request->baseFile(false)), '\\/'); + if ($type !== 'path') { + $domain = sysconf('storage.local_http_domain') ?: $this->app->request->host(); if ($type === 'auto') $this->prefix = "//{$domain}"; elseif ($type === 'http') $this->prefix = "http://{$domain}"; elseif ($type === 'https') $this->prefix = "https://{$domain}"; } - // 初始化配置并返回当前实例 return parent::initialize(); } diff --git a/vendor/zoujingli/think-library/src/storage/QiniuStorage.php b/vendor/zoujingli/think-library/src/storage/QiniuStorage.php index f6c7086b9..956f2d688 100644 --- a/vendor/zoujingli/think-library/src/storage/QiniuStorage.php +++ b/vendor/zoujingli/think-library/src/storage/QiniuStorage.php @@ -31,7 +31,7 @@ class QiniuStorage extends Storage /** * 初始化入口 - * @return Storage + * @return static * @throws \think\admin\Exception * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException