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

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

View File

@@ -1,5 +1,6 @@
package cn.keking.service.impl;
import cn.keking.config.ConfigConstants;
import cn.keking.model.FileAttribute;
import cn.keking.model.ReturnResponse;
import cn.keking.service.FilePreview;
@@ -33,6 +34,7 @@ public class PictureFilePreviewImpl implements FilePreview {
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
String fileKey = (String) RequestContextHolder.currentRequestAttributes().getAttribute("fileKey",0);
List<String> imgUrls = Lists.newArrayList(url);
model.addAttribute("switchDisabled", ConfigConstants.getOfficePreviewSwitchDisabled());
try {
imgUrls.clear();
imgUrls.addAll(fileUtils.getImgCache(fileKey));