!313 修复上传七牛云无mime type问题

Merge pull request !313 from 石溪/master
This commit is contained in:
芋道源码
2022-11-29 13:12:54 +00:00
committed by Gitee
14 changed files with 15 additions and 14 deletions

View File

@@ -230,7 +230,7 @@ public class FileConfigServiceImpl implements FileConfigService {
this.validateFileConfigExists(id);
// 上传文件
byte[] content = ResourceUtil.readBytes("file/erweima.jpg");
return fileClientFactory.getFileClient(id).upload(content, IdUtil.fastSimpleUUID() + ".jpg");
return fileClientFactory.getFileClient(id).upload(content, IdUtil.fastSimpleUUID() + ".jpg", "image/jpeg");
}
@Override

View File

@@ -52,7 +52,7 @@ public class FileServiceImpl implements FileService {
// 上传到文件存储器
FileClient client = fileConfigService.getMasterFileClient();
Assert.notNull(client, "客户端(master) 不能为空");
String url = client.upload(content, path);
String url = client.upload(content, path, type);
// 保存到数据库
FileDO file = new FileDO();