mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-09 08:57:16 +08:00
feat: 文件管理存储路径改为相对路径 (#69)
This commit is contained in:
@@ -58,10 +58,10 @@ public class FileRecorderImpl implements FileRecorder {
|
||||
? StrUtil.subBefore(originalFilename, StringConstants.DOT, true)
|
||||
: originalFilename);
|
||||
file.setSize(fileInfo.getSize());
|
||||
file.setUrl(fileInfo.getUrl());
|
||||
file.setUrl(fileInfo.getPath() + fileInfo.getFilename());
|
||||
file.setExtension(fileInfo.getExt());
|
||||
file.setType(FileTypeEnum.getByExtension(file.getExtension()));
|
||||
file.setThumbnailUrl(fileInfo.getThUrl());
|
||||
file.setThumbnailUrl(fileInfo.getPath() + fileInfo.getThFilename());
|
||||
file.setThumbnailSize(fileInfo.getThSize());
|
||||
StorageDO storage = (StorageDO)fileInfo.getAttr().get(ClassUtil.getClassName(StorageDO.class, false));
|
||||
file.setStorageId(storage.getId());
|
||||
|
@@ -145,6 +145,8 @@ public class StorageServiceImpl extends BaseServiceImpl<StorageMapper, StorageDO
|
||||
ValidationUtils.throwIfBlank(secretKey, "私有密钥不能为空");
|
||||
ValidationUtils.throwIfBlank(endpoint, "终端节点不能为空");
|
||||
ValidationUtils.throwIfBlank(bucketName, "桶名称不能为空");
|
||||
ValidationUtils.throwIfBlank(domain, "域名不能为空");
|
||||
ValidationUtils.throwIf(!URLUtils.isHttpUrl(domain), "域名格式错误");
|
||||
FileStorageProperties.AmazonS3Config config = new FileStorageProperties.AmazonS3Config();
|
||||
config.setPlatform(req.getCode());
|
||||
config.setAccessKey(accessKey);
|
||||
|
Reference in New Issue
Block a user