|
|
|
@ -9,6 +9,10 @@ import org.jeecg.common.exception.JeecgBootException; |
|
|
|
|
import org.jeecg.common.util.CommonUtils; |
|
|
|
|
import org.jeecg.common.util.filter.SsrfFileTypeFilter; |
|
|
|
|
import org.jeecg.common.util.oConvertUtils; |
|
|
|
|
import org.jeecg.common.util.oss.OssBootUtil; |
|
|
|
|
import org.jeecg.modules.oss.entity.OssFile; |
|
|
|
|
import org.jeecg.modules.oss.service.IOssFileService; |
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
|
import org.springframework.util.AntPathMatcher; |
|
|
|
@ -45,6 +49,9 @@ public class CommonController { |
|
|
|
|
@Value(value="${jeecg.uploadType}") |
|
|
|
|
private String uploadType; |
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
|
private IOssFileService ossFileService; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @Author 政辉 |
|
|
|
|
* @return |
|
|
|
@ -111,6 +118,15 @@ public class CommonController { |
|
|
|
|
//update-end-author:taoyan date:20200814 for:文件上传改造
|
|
|
|
|
} |
|
|
|
|
if(oConvertUtils.isNotEmpty(savePath)){ |
|
|
|
|
String fileName = file.getOriginalFilename(); |
|
|
|
|
fileName = CommonUtils.getFileName(fileName); |
|
|
|
|
|
|
|
|
|
//保存附件地地
|
|
|
|
|
OssFile ossFile = new OssFile(); |
|
|
|
|
ossFile.setFileName(fileName); |
|
|
|
|
ossFile.setUrl(savePath); |
|
|
|
|
ossFileService.save(ossFile); |
|
|
|
|
|
|
|
|
|
result.setMessage(savePath); |
|
|
|
|
result.setSuccess(true); |
|
|
|
|
}else { |
|
|
|
|