pull/1/head
wanghousheng 10 months ago
parent 701d9f8230
commit dd79cf3b7d
  1. 6
      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']}";
}

Loading…
Cancel
Save