支持FTP文件地址作为预览源url

This commit is contained in:
陈精华
2019-06-19 14:18:09 +08:00
committed by kl
parent a78f1e5f8e
commit 37762cf034
11 changed files with 161 additions and 32 deletions

View File

@@ -30,12 +30,11 @@ public class CompressFilePreviewImpl implements FilePreview{
@Override
public String filePreviewHandle(String url, Model model, FileAttribute fileAttribute) {
String fileName=fileAttribute.getName();
String decodedUrl=fileAttribute.getDecodedUrl();
String suffix=fileAttribute.getSuffix();
String fileTree = null;
// 判断文件名是否存在(redis缓存读取)
if (!StringUtils.hasText(fileUtils.getConvertedFile(fileName))) {
ReturnResponse<String> response = downloadUtils.downLoad(decodedUrl, suffix, fileName);
ReturnResponse<String> response = downloadUtils.downLoad(fileAttribute, fileName);
if (0 != response.getCode()) {
model.addAttribute("fileType", suffix);
model.addAttribute("msg", response.getMsg());