|
|
@ -12,10 +12,10 @@ declare (strict_types=1); |
|
|
|
|
|
|
|
|
|
|
|
namespace app\common\model; |
|
|
|
namespace app\common\model; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
use app\common\enum\file\FileType as FileTypeEnum; |
|
|
|
|
|
|
|
use app\common\enum\file\Storage as StorageEnum; |
|
|
|
use cores\BaseModel; |
|
|
|
use cores\BaseModel; |
|
|
|
use think\model\relation\BelongsTo; |
|
|
|
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) { |
|
|
|
if ($data['storage'] === StorageEnum::LOCAL) { |
|
|
|
$data['domain'] = rtrim(uploads_url(), '/'); |
|
|
|
$data['domain'] = rtrim(uploads_url(), '/'); |
|
|
|
|
|
|
|
} elseif ($data['storage'] === StorageEnum::EXTERNAL) { |
|
|
|
|
|
|
|
return "{$data['file_path']}"; |
|
|
|
} |
|
|
|
} |
|
|
|
return "{$data['domain']}/{$data['file_path']}"; |
|
|
|
return "{$data['domain']}/{$data['file_path']}"; |
|
|
|
} |
|
|
|
} |
|
|
|