From 34354837d572698b695a3a9594d74794c61add88 Mon Sep 17 00:00:00 2001 From: Rodots Date: Wed, 6 Nov 2024 14:51:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=AD=A3=E5=91=BD=E5=90=8D?= =?UTF-8?q?=E7=A9=BA=E9=97=B4=EF=BC=8C=E7=A7=BB=E9=99=A4=E6=97=A0=E7=94=A8?= =?UTF-8?q?=E7=B1=BB=E7=9A=84=E5=BC=95=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/curd/exceptions/CurdException.php | 4 +- .../service/curd/exceptions/FileException.php | 4 +- .../curd/exceptions/TableException.php | 2 +- app/common/command/OssStatic.php | 47 ------------------- app/common/service/AuthService.php | 1 - 5 files changed, 5 insertions(+), 53 deletions(-) delete mode 100644 app/common/command/OssStatic.php diff --git a/app/admin/service/curd/exceptions/CurdException.php b/app/admin/service/curd/exceptions/CurdException.php index 963ad67..fcd26e5 100644 --- a/app/admin/service/curd/exceptions/CurdException.php +++ b/app/admin/service/curd/exceptions/CurdException.php @@ -1,8 +1,8 @@ setName('OssStatic') - ->setDescription('将静态资源上传到oss上'); - } - - protected function execute(Input $input, Output $output) - { - $output->writeln("========正在上传静态资源到OSS上:========" . date('Y-m-d H:i:s')); - $dir = root_path() . 'public' . DIRECTORY_SEPARATOR . 'static'; - $list = CommonTool::readDirAllFiles($dir); - $uploadConfig = sysConfig('upload'); - $uploadPrefix = config('app.oss_static_prefix', 'oss_static_prefix'); - foreach ($list as $key => $val) { - list($objectName, $filePath) = [$uploadPrefix . DIRECTORY_SEPARATOR . $key, $val]; - try { - $upload = Oss::instance($uploadConfig) - ->save($objectName, $filePath); - } catch (\Exception $e) { - CliEcho::error('文件上传失败:' . $filePath . '。错误信息:' . $e->getMessage()); - continue; - } - if ($upload['save'] == true) { - CliEcho::success('文件上传成功:' . $filePath . '。上传地址:' . $upload['url']); - } else { - CliEcho::error('文件上传失败:' . $filePath . '。错误信息:' . $upload['msg']); - } - } - $output->writeln("========已完成静态资源上传到OSS上:========" . date('Y-m-d H:i:s')); - } - -} \ No newline at end of file diff --git a/app/common/service/AuthService.php b/app/common/service/AuthService.php index f66d539..9e2e36e 100644 --- a/app/common/service/AuthService.php +++ b/app/common/service/AuthService.php @@ -3,7 +3,6 @@ namespace app\common\service; use app\common\constants\AdminConstant; -use EasyAdmin\tool\CommonTool; use think\facade\Db; /**