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']}"; }