diff --git a/server/src/main/java/cn/keking/service/impl/CadFilePreviewImpl.java b/server/src/main/java/cn/keking/service/impl/CadFilePreviewImpl.java index 155821c33655651aaa037c129d1dc7b957183dcd..932e48ddf44ec00dcdedacde8730752c9dec5ce7 100644 --- a/server/src/main/java/cn/keking/service/impl/CadFilePreviewImpl.java +++ b/server/src/main/java/cn/keking/service/impl/CadFilePreviewImpl.java @@ -45,11 +45,17 @@ public class CadFilePreviewImpl implements FilePreview { String outFilePath = fileAttribute.getOutFilePath(); // 判断之前是否已转换过,如果转换过,直接返回,否则执行转换 if (forceUpdatedCache || !fileHandlerService.listConvertedFiles().containsKey(cacheName) || !ConfigConstants.isCacheEnabled()) { - ReturnResponse response = DownloadUtils.downLoad(fileAttribute, fileName); - if (response.isFailure()) { - return otherFilePreview.notSupportedFile(model, fileAttribute, response.getMsg()); + String filePath = ""; + if(fileAttribute.getCompressFile()) { + //如果是压缩文件预览无需重新下载 + filePath = fileAttribute.getOriginFilePath(); + } else { + ReturnResponse response = DownloadUtils.downLoad(fileAttribute, fileName); + if (response.isFailure()) { + return otherFilePreview.notSupportedFile(model, fileAttribute, response.getMsg()); + } + filePath = response.getContent(); } - String filePath = response.getContent(); String imageUrls = null; if (StringUtils.hasText(outFilePath)) { try {