update server/src/main/java/cn/keking/service/impl/CadFilePreviewImpl.java.

压缩文件无法预览问题修复

Signed-off-by: 马云 <12845730+jack-ma2023@user.noreply.gitee.com>
This commit is contained in:
马云 2025-05-18 11:36:23 +00:00 committed by Gitee
parent 6746325bf2
commit 27ce42b397
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -45,11 +45,17 @@ public class CadFilePreviewImpl implements FilePreview {
String outFilePath = fileAttribute.getOutFilePath();
// 判断之前是否已转换过如果转换过直接返回否则执行转换
if (forceUpdatedCache || !fileHandlerService.listConvertedFiles().containsKey(cacheName) || !ConfigConstants.isCacheEnabled()) {
ReturnResponse<String> 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<String> 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 {