新增配置项office.preview.switch.disabled,控制offic文件预览切换开关

This commit is contained in:
kl
2020-12-25 18:19:30 +08:00
committed by kl
parent 4a3886e41a
commit d787813bc6
9 changed files with 27 additions and 4 deletions

View File

@ -54,6 +54,7 @@ public class OfficeFilePreviewImpl implements FilePreview {
boolean isHtml = suffix.equalsIgnoreCase("xls") || suffix.equalsIgnoreCase("xlsx");
String pdfName = fileName.substring(0, fileName.lastIndexOf(".") + 1) + (isHtml ? "html" : "pdf");
String outFilePath = FILE_DIR + pdfName;
model.addAttribute("switchDisabled", ConfigConstants.getOfficePreviewSwitchDisabled());
// 判断之前是否已转换过,如果转换过,直接返回,否则执行转换
if (!fileUtils.listConvertedFiles().containsKey(pdfName) || !ConfigConstants.isCacheEnabled()) {
String filePath;