ComposerUpdate

This commit is contained in:
Anyon 2020-07-30 19:00:36 +08:00
parent 6aeb6d0c96
commit 96f54f8d5e
7 changed files with 26 additions and 20 deletions

View File

@ -26,6 +26,16 @@
</div> </div>
</div> </div>
<div class="layui-form-item">
<label class="layui-form-label" for="storage.local_http_domain">
<span class="color-green font-w7">访问域名</span><br><span class="nowrap color-desc">Domain</span>
</label>
<div class="layui-input-block">
<input id="storage.local_http_domain" type="text" name="storage.local_http_domain" value="{:sysconf('storage.local_http_domain')}" placeholder="请输入上传后的访问域名 (非必填项)" class="layui-input">
<p class="help-block">填写上传后的访问域名不指定时根据当前访问地址自动计算static.ctolog.com</p>
</div>
</div>
<div class="hr-line-dashed margin-left-40"></div> <div class="hr-line-dashed margin-left-40"></div>
<input type="hidden" name="storage.type" value="local"> <input type="hidden" name="storage.type" value="local">

8
composer.lock generated
View File

@ -879,12 +879,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "c5ae2601c499d95776061aeda087478f7912c2c5" "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5ae2601c499d95776061aeda087478f7912c2c5", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f",
"reference": "c5ae2601c499d95776061aeda087478f7912c2c5", "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -928,7 +928,7 @@
], ],
"description": "ThinkPHP v6.0 Development Library", "description": "ThinkPHP v6.0 Development Library",
"homepage": "http://framework.thinkadmin.top", "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", "name": "zoujingli/wechat-developer",

View File

@ -903,12 +903,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/zoujingli/ThinkLibrary.git", "url": "https://github.com/zoujingli/ThinkLibrary.git",
"reference": "c5ae2601c499d95776061aeda087478f7912c2c5" "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/c5ae2601c499d95776061aeda087478f7912c2c5", "url": "https://api.github.com/repos/zoujingli/ThinkLibrary/zipball/54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f",
"reference": "c5ae2601c499d95776061aeda087478f7912c2c5", "reference": "54dfd26bd7de6bb86d233f4bb03b80d3b475ce7f",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
@ -924,7 +924,7 @@
"ext-json": "*", "ext-json": "*",
"topthink/framework": "^6.0" "topthink/framework": "^6.0"
}, },
"time": "2020-07-30T09:50:41+00:00", "time": "2020-07-30T10:54:48+00:00",
"type": "library", "type": "library",
"extra": { "extra": {
"think": { "think": {

2
vendor/services.php vendored
View File

@ -1,5 +1,5 @@
<?php <?php
// This file is automatically generated at:2020-07-30 17:53:29 // This file is automatically generated at:2020-07-30 19:00:19
declare (strict_types = 1); declare (strict_types = 1);
return array ( return array (
0 => 'think\\admin\\Library', 0 => 'think\\admin\\Library',

View File

@ -51,7 +51,7 @@ class AliossStorage extends Storage
/** /**
* 初始化入口 * 初始化入口
* @return Storage * @return static
* @throws \think\admin\Exception * @throws \think\admin\Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException

View File

@ -27,26 +27,22 @@ class LocalStorage extends Storage
/** /**
* 初始化入口 * 初始化入口
* @return Storage * @return static
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
*/ */
protected function initialize() protected function initialize()
{ {
// 计算链接前缀
$type = strtolower(sysconf('storage.local_http_protocol')); $type = strtolower(sysconf('storage.local_http_protocol'));
if ($type === 'path') { if ($type === 'follow') $type = $this->app->request->scheme();
$file = $this->app->request->baseFile(false); $this->prefix = trim(dirname($this->app->request->baseFile(false)), '\\/');
$this->prefix = trim(dirname($file), '\\/'); if ($type !== 'path') {
} else { $domain = sysconf('storage.local_http_domain') ?: $this->app->request->host();
$this->prefix = dirname($this->app->request->basefile(true));
list(, $domain) = explode('://', strtr($this->prefix, '\\', '/'));
if ($type === 'auto') $this->prefix = "//{$domain}"; if ($type === 'auto') $this->prefix = "//{$domain}";
elseif ($type === 'http') $this->prefix = "http://{$domain}"; elseif ($type === 'http') $this->prefix = "http://{$domain}";
elseif ($type === 'https') $this->prefix = "https://{$domain}"; elseif ($type === 'https') $this->prefix = "https://{$domain}";
} }
// 初始化配置并返回当前实例
return parent::initialize(); return parent::initialize();
} }

View File

@ -31,7 +31,7 @@ class QiniuStorage extends Storage
/** /**
* 初始化入口 * 初始化入口
* @return Storage * @return static
* @throws \think\admin\Exception * @throws \think\admin\Exception
* @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException * @throws \think\db\exception\DbException