diff --git a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java index 4a1c4a7e5..6bcbe6869 100644 --- a/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java +++ b/jero-boot/jero-boot-module-system/src/main/java/com/jero/modules/system/controller/CommonController.java @@ -13,6 +13,7 @@ import lombok.extern.slf4j.Slf4j; import com.jero.common.api.vo.Result; import com.jero.common.constant.CommonConstant; import com.jero.common.system.api.ISysBaseAPI; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpHeaders; @@ -254,15 +255,18 @@ public class CommonController { * @param request * @param response */ - @GetMapping(value = "/download/**") - public void downLoad(String id,HttpServletRequest request, HttpServletResponse response) { - id = id.split(".")[0]; + @GetMapping(value = "/download/{id}") + public void downLoad(@PathVariable("id") String id,HttpServletRequest request, HttpServletResponse response) { + if(StringUtils.isBlank(id)){ + throw new JeroBootException("参数信息不全"); + } + id = id.split("\\.")[0]; // 查询数据表数据是否存在 LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); queryWrapper.eq(OSSFile::getId,id); OSSFile ossFile = ossFileService.getOne(queryWrapper); if( null == ossFile){ - throw new JeroBootException("文件不存在.."); + throw new JeroBootException("文件不存在"); } InputStream inputStream = null; OutputStream outputStream = null;