From dd79cf3b7d50a59cc398c898dc4a0342db852eeb Mon Sep 17 00:00:00 2001 From: wanghousheng Date: Fri, 2 Feb 2024 00:50:51 +0800 Subject: [PATCH] 1 --- app/common/model/UploadFile.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/common/model/UploadFile.php b/app/common/model/UploadFile.php index 940c3ea0..7a2f1be5 100644 --- a/app/common/model/UploadFile.php +++ b/app/common/model/UploadFile.php @@ -12,10 +12,10 @@ declare (strict_types=1); namespace app\common\model; +use app\common\enum\file\FileType as FileTypeEnum; +use app\common\enum\file\Storage as StorageEnum; use cores\BaseModel; use think\model\relation\BelongsTo; -use app\common\enum\file\Storage as StorageEnum; -use app\common\enum\file\FileType as FileTypeEnum; /** * 文件库模型 @@ -73,6 +73,8 @@ class UploadFile extends BaseModel // 存储方式本地:拼接当前域名 if ($data['storage'] === StorageEnum::LOCAL) { $data['domain'] = rtrim(uploads_url(), '/'); + } elseif ($data['storage'] === StorageEnum::EXTERNAL) { + return "{$data['file_path']}"; } return "{$data['domain']}/{$data['file_path']}"; }