From 1a8e8d6716fcb9fa2f9be3b37409c5270161a91a Mon Sep 17 00:00:00 2001 From: augushong Date: Mon, 11 Jul 2022 22:02:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E8=85=BE=E8=AE=AF=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/initAdminData/SystemConfig.php | 2 +- app/admin/view/system/config/upload.html | 9 +- app/common.php | 6 +- composer.json | 1 - composer.lock | 151 +++++++++++++++--- config/filesystem.php | 2 +- extend/think/filesystem/driver/Txcos.php | 3 +- 7 files changed, 143 insertions(+), 31 deletions(-) diff --git a/app/admin/service/initAdminData/SystemConfig.php b/app/admin/service/initAdminData/SystemConfig.php index dac9593..2234530 100644 --- a/app/admin/service/initAdminData/SystemConfig.php +++ b/app/admin/service/initAdminData/SystemConfig.php @@ -190,7 +190,7 @@ $ul_system_config = array( "sort" => 0, ), array( - "name" => "tecos_bucket", + "name" => "txcos_bucket", "group" => "upload", "value" => "填你的", "remark" => "存储桶名称", diff --git a/app/admin/view/system/config/upload.html b/app/admin/view/system/config/upload.html index 5086073..17dc208 100644 --- a/app/admin/view/system/config/upload.html +++ b/app/admin/view/system/config/upload.html @@ -92,10 +92,17 @@
- + 例子:ulthon-admin-1251997243
+
+ +
+ + 例子:https://xh-1255063857.cos.ap-chengdu.myqcloud.com +
+
diff --git a/app/common.php b/app/common.php index a422c90..97f07d2 100644 --- a/app/common.php +++ b/app/common.php @@ -241,9 +241,9 @@ function build_upload_url($url) case 'alioss': $prefix_url = $config['alioss_domain']; break; - // case 'alioss': - // $prefix_url = $config['alioss_domain']; - // break; + case 'txcos': + $prefix_url = $config['txcos_domain']; + break; default: # code... diff --git a/composer.json b/composer.json index c31ffa8..98db556 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,6 @@ "topthink/think-multi-app": "^1.0", "topthink/think-view": "^1.0", "topthink/think-captcha": "^3.0", - "qcloud/cos-sdk-v5": "^2.0", "zhongshaofa/easy-admin": "^1.0.2", "ext-json": "*", "guzzlehttp/guzzle": "^7.4", diff --git a/composer.lock b/composer.lock index a26e9c6..d053c16 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "2dae06d14067806fb0de04359c23b7e7", + "content-hash": "fdcd785c44698afc23b274a2b7f63fa6", "packages": [ { "name": "aliyuncs/oss-sdk-php", @@ -278,9 +278,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/guzzlehttp/command/1.2.2/guzzlehttp-command-1.2.2.zip", + "url": "https://api.github.com/repos/guzzle/command/zipball/7883359e0ecab8a8f7c43aad2fc36360a35d21e8", "reference": "7883359e0ecab8a8f7c43aad2fc36360a35d21e8", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "guzzlehttp/guzzle": "^7.4.1", @@ -302,6 +308,7 @@ "GuzzleHttp\\Command\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -328,6 +335,10 @@ } ], "description": "Provides the foundation for building command-based web service clients", + "support": { + "issues": "https://github.com/guzzle/command/issues", + "source": "https://github.com/guzzle/command/tree/1.2.2" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -473,9 +484,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/guzzlehttp/guzzle-services/1.3.2/guzzlehttp-guzzle-services-1.3.2.zip", + "url": "https://api.github.com/repos/guzzle/guzzle-services/zipball/4989d902dd4e0411b320e851c46f3c94d652d891", "reference": "4989d902dd4e0411b320e851c46f3c94d652d891", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "guzzlehttp/command": "^1.2.2", @@ -501,6 +518,7 @@ "GuzzleHttp\\Command\\Guzzle\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -527,6 +545,10 @@ } ], "description": "Provides an implementation of the Guzzle Command library that uses Guzzle service descriptions to describe web services, serialize requests, and parse responses into easy to use model structures.", + "support": { + "issues": "https://github.com/guzzle/guzzle-services/issues", + "source": "https://github.com/guzzle/guzzle-services/tree/1.3.2" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -553,9 +575,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/guzzlehttp/promises/1.5.1/guzzlehttp-promises-1.5.1.zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/fe752aedc9fd8fcca3fe7ad05d419d32998a06da", "reference": "fe752aedc9fd8fcca3fe7ad05d419d32998a06da", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.5" @@ -577,6 +605,7 @@ "GuzzleHttp\\Promise\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -606,6 +635,10 @@ "keywords": [ "promise" ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/1.5.1" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -632,9 +665,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/guzzlehttp/psr7/2.4.0/guzzlehttp-psr7-2.4.0.zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/13388f00956b1503577598873fffb5ae994b5737", "reference": "13388f00956b1503577598873fffb5ae994b5737", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2.5 || ^8.0", @@ -665,6 +704,7 @@ "GuzzleHttp\\Psr7\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -716,6 +756,10 @@ "uri", "url" ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.4.0" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -742,9 +786,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/guzzlehttp/uri-template/v1.0.1/guzzlehttp-uri-template-v1.0.1.zip", + "url": "https://api.github.com/repos/guzzle/uri-template/zipball/b945d74a55a25a949158444f09ec0d3c120d69e2", "reference": "b945d74a55a25a949158444f09ec0d3c120d69e2", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": "^7.2.5 || ^8.0", @@ -765,6 +815,7 @@ "GuzzleHttp\\UriTemplate\\": "src" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -795,6 +846,10 @@ "guzzlehttp", "uri-template" ], + "support": { + "issues": "https://github.com/guzzle/uri-template/issues", + "source": "https://github.com/guzzle/uri-template/tree/v1.0.1" + }, "funding": [ { "url": "https://github.com/GrahamCampbell", @@ -1510,9 +1565,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/psr/http-factory/1.0.1/psr-http-factory-1.0.1.zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/12ac7fcd07e5b077433f5f2bee95b3a771bf61be", "reference": "12ac7fcd07e5b077433f5f2bee95b3a771bf61be", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.0.0", @@ -1529,6 +1590,7 @@ "Psr\\Http\\Message\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1549,6 +1611,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-factory/tree/master" + }, "time": "2019-04-30T12:38:16+00:00" }, { @@ -1561,9 +1626,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/psr/http-message/1.0.1/psr-http-message-1.0.1.zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.3.0" @@ -1579,6 +1650,7 @@ "Psr\\Http\\Message\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1598,6 +1670,9 @@ "request", "response" ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/master" + }, "time": "2016-08-06T14:39:51+00:00" }, { @@ -1703,9 +1778,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/qcloud/cos-sdk-v5/v2.5.6/qcloud-cos-sdk-v5-v2.5.6.zip", + "url": "https://api.github.com/repos/tencentyun/cos-php-sdk-v5/zipball/607ee49d372a799964206b6ae0a9eb2816201c42", "reference": "607ee49d372a799964206b6ae0a9eb2816201c42", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "ext-curl": "*", @@ -1730,6 +1811,7 @@ "Qcloud\\Cos\\": "src/" } }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1753,6 +1835,10 @@ "php", "qcloud" ], + "support": { + "issues": "https://github.com/tencentyun/cos-php-sdk-v5/issues", + "source": "https://github.com/tencentyun/cos-php-sdk-v5/tree/v2.5.6" + }, "time": "2022-06-07T14:49:19+00:00" }, { @@ -1816,9 +1902,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/ralouphie/getallheaders/3.0.3/ralouphie-getallheaders-3.0.3.zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=5.6" @@ -1833,6 +1925,7 @@ "src/getallheaders.php" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -1843,6 +1936,10 @@ } ], "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, "time": "2019-03-08T08:55:37+00:00" }, { @@ -1997,9 +2094,15 @@ }, "dist": { "type": "zip", - "url": "https://repo.huaweicloud.com/repository/php/symfony/polyfill-php80/v1.26.0/symfony-polyfill-php80-v1.26.0.zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/cfa0ae98841b9e461207c13ab093d76b0fa7bace", "reference": "cfa0ae98841b9e461207c13ab093d76b0fa7bace", - "shasum": "" + "shasum": "", + "mirrors": [ + { + "url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%", + "preferred": true + } + ] }, "require": { "php": ">=7.1" @@ -2025,6 +2128,7 @@ "Resources/stubs" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -2050,6 +2154,9 @@ "portable", "shim" ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.26.0" + }, "funding": [ { "url": "https://symfony.com/sponsor", @@ -2734,5 +2841,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.0.0" } diff --git a/config/filesystem.php b/config/filesystem.php index 58a34ea..46d3491 100644 --- a/config/filesystem.php +++ b/config/filesystem.php @@ -15,7 +15,7 @@ return [ // 磁盘类型 'type' => 'local', // 磁盘路径 - 'root' => app()->getRootPath() . 'public', + 'root' => app()->getRootPath() . 'public/storage', // 磁盘路径对应的外部URL路径 'url' => '/storage', // 可见性 diff --git a/extend/think/filesystem/driver/Txcos.php b/extend/think/filesystem/driver/Txcos.php index 3773292..4abd283 100644 --- a/extend/think/filesystem/driver/Txcos.php +++ b/extend/think/filesystem/driver/Txcos.php @@ -10,7 +10,6 @@ class Txcos extends Driver { protected function createAdapter(): AdapterInterface { - $secretId = sysconfig('upload', 'txcos_secret_id'); $secretKey = sysconfig('upload', 'txcos_secret_key'); $region = sysconfig('upload', 'txcos_region'); //set a default bucket region 设置一个默认的存储桶地域 @@ -25,7 +24,7 @@ class Txcos extends Driver 'signHost' => false ) ); - $bucket = sysconfig('upload', 'tecos_bucket'); //存储桶名称 格式:BucketName-APPID + $bucket = sysconfig('upload', 'txcos_bucket'); //存储桶名称 格式:BucketName-APPID