From 2a3dcb656428942c8687af9e05b1f2e3590fa427 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Mon, 8 May 2023 18:53:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B8=8B=E8=BD=BD=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/idc/controller/IdcController.java | 1 - .../java/com/glxp/api/idc/service/impl/IdcServiceImpl.java | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/idc/controller/IdcController.java b/src/main/java/com/glxp/api/idc/controller/IdcController.java index 8eac70e9..d70d4cdf 100644 --- a/src/main/java/com/glxp/api/idc/controller/IdcController.java +++ b/src/main/java/com/glxp/api/idc/controller/IdcController.java @@ -112,7 +112,6 @@ public class IdcController { response.setContentType("application/force-download"); idcService.downloadFile(fileName, response); } - } @RequestMapping("/mapi/**") diff --git a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java index 333f28af..9c146844 100644 --- a/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java +++ b/src/main/java/com/glxp/api/idc/service/impl/IdcServiceImpl.java @@ -629,7 +629,8 @@ public class IdcServiceImpl implements IdcService { public void downloadFile(String fileName, HttpServletResponse response) { OutputStream os; String filePathSlash = filePath.substring(filePath.length() - 1).equals("/") ? "" : fileName.substring(0, 1).equals("/") ? "" : "/"; - String sourceFileName = filePath +filePathSlash+imagePath +fileName; +// String sourceFileName = filePath +filePathSlash+imagePath +fileName; + String sourceFileName = fileName; try { if (FileUtils.isFileExist(sourceFileName)) { byte[] bytes = FileUtils.readFileByBytes(sourceFileName);