1.修复不支持文件类型提示时抛异常的问题
2.添加多媒体文件预览支持,如mp4,mp3等文件
This commit is contained in:
@ -0,0 +1,27 @@
|
||||
package cn.keking.service.impl;
|
||||
|
||||
import cn.keking.service.FilePreview;
|
||||
import cn.keking.utils.FileUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.ui.Model;
|
||||
/**
|
||||
* @author : kl
|
||||
* @authorboke : kailing.pub
|
||||
* @create : 2018-03-25 上午11:58
|
||||
* @description:
|
||||
**/
|
||||
@Service
|
||||
public class MediaFilePreviewImpl implements FilePreview {
|
||||
|
||||
@Autowired
|
||||
FileUtils fileUtils;
|
||||
|
||||
@Override
|
||||
public String filePreviewHandle(String url, Model model) {
|
||||
model.addAttribute("mediaUrl", url);
|
||||
return "media";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user