修复压缩获取路径错误,图片合集路径错误,水印问题等BUG

This commit is contained in:
gaoxiongzaq
2024-05-27 14:21:11 +08:00
parent 0a4ae41b0c
commit 48ac926289
6 changed files with 39 additions and 25 deletions

View File

@@ -54,15 +54,11 @@ public class CompressFilePreviewImpl implements FilePreview {
try {
fileTree = compressFileReader.unRar(filePath, filePassword, fileName, fileAttribute);
} catch (Exception e) {
logger.error("Error processing RAR file: " + e.getMessage(), e);
Throwable[] throwableArray = ExceptionUtils.getThrowables(e);
for (Throwable throwable : throwableArray) {
if (throwable instanceof IOException || throwable instanceof EncryptedDocumentException) {
if (e.getMessage().toLowerCase().contains(Rar_PASSWORD_MSG)) {
model.addAttribute("needFilePassword", true);
return EXEL_FILE_PREVIEW_PAGE;
}
}
if (e.getMessage().toLowerCase().contains(Rar_PASSWORD_MSG)) {
model.addAttribute("needFilePassword", true);
return EXEL_FILE_PREVIEW_PAGE;
}else {
logger.error("Error processing RAR file: " + e.getMessage(), e);
}
}
if (!ObjectUtils.isEmpty(fileTree)) {