From b115f5affe9618261c0cdd23da00892ce4af9b0c Mon Sep 17 00:00:00 2001 From: Jinquan_Ou <Jinquan@gdut.com> Date: 星期一, 20 三月 2023 23:26:39 +0800 Subject: [PATCH] asd --- zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-) diff --git a/zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java b/zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java index 96a331b..866a6b5 100644 --- a/zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java +++ b/zhang-content/src/main/java/com/ruoyi/service/impl/DownLoadFileServiceImpl.java @@ -2,6 +2,7 @@ import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.service.DownLoadFileService; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import javax.servlet.http.HttpServletResponse; @@ -14,9 +15,14 @@ */ @Service public class DownLoadFileServiceImpl implements DownLoadFileService { - @Override - public AjaxResult downLoadFile(String path, HttpServletResponse response) { + @Value("${ruoyi.profile}") + private String basePath; + + @Override + public void downLoadFile(String path, HttpServletResponse response) { + + path=basePath+path.substring(8); File file = new File(path); byte[] buffer = new byte[1024]; BufferedInputStream bis = null; @@ -50,6 +56,5 @@ e.printStackTrace(); } } - return AjaxResult.success("鎿嶄綔鎴愬姛"); } } -- Gitblit v1.9.1