fix 修复 OssClient 切换服务 实例不正确问题

This commit is contained in:
疯狂的狮子Li
2023-06-04 13:18:13 +08:00
parent 0226c2de1f
commit 514150b92f

View File

@@ -111,7 +111,7 @@ public class SysOssServiceImpl implements ISysOssService {
}
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
OssClient storage = OssFactory.instance();
OssClient storage = OssFactory.instance(sysOss.getService());
try(InputStream inputStream = storage.getObjectContent(sysOss.getUrl())) {
int available = inputStream.available();
IoUtil.copy(inputStream, response.getOutputStream(), available);