From 70b7f60905afcefa6afa65639f6842f80de84ad4 Mon Sep 17 00:00:00 2001 From: peihaoyu <617594538@qq.com> Date: Fri, 8 Jan 2021 09:10:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BF=9D=E5=AD=98=E5=9C=B0?= =?UTF-8?q?=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/qinxx/hslink/controller/HSController.java | 3 +++ .../com/qinxx/hslink/service/impl/AdminHSServiceImpl.java | 3 +++ .../additional-spring-configuration-metadata.json | 8 -------- HSLink-back/src/main/resources/application.yml | 5 ++++- 4 files changed, 10 insertions(+), 9 deletions(-) delete mode 100644 HSLink-back/src/main/resources/META-INF/additional-spring-configuration-metadata.json diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java b/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java index 8cfddf9..4da1e68 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java +++ b/HSLink-back/src/main/java/com/qinxx/hslink/controller/HSController.java @@ -483,6 +483,9 @@ public class HSController { */ @RequestMapping("/showImg/{fileName}") private void responPhoto(HttpServletResponse response, @PathVariable(value = "fileName") String fileName) throws IOException { + //Linux环境下的路径 +// String filePath = filesPath + "/" + fileName; + //Window环境下的路径 String filePath = filesPath + "\\" + fileName; File imageFile = new File(filePath); if (imageFile.exists()) { diff --git a/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/AdminHSServiceImpl.java b/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/AdminHSServiceImpl.java index 9e65be3..27edbbf 100644 --- a/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/AdminHSServiceImpl.java +++ b/HSLink-back/src/main/java/com/qinxx/hslink/service/impl/AdminHSServiceImpl.java @@ -203,6 +203,9 @@ public class AdminHSServiceImpl implements AdminHSService { @Override public Map deleteRotationPhoto(Map param) { int res = 0; + //Linux环境下的路径 +// File file = new File(filesPath + "/" + param.get("fileEncryption")); + //Window环境下的路径 File file = new File(filesPath + "\\" + param.get("fileEncryption")); // 路径为文件且不为空则进行删除 if (file.isFile() && file.exists()) { diff --git a/HSLink-back/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/HSLink-back/src/main/resources/META-INF/additional-spring-configuration-metadata.json deleted file mode 100644 index c38db42..0000000 --- a/HSLink-back/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "properties": [ - { - "name": "filePath", - "type": "java.lang.String", - "description": "Description for filePath." - } -] } \ No newline at end of file diff --git a/HSLink-back/src/main/resources/application.yml b/HSLink-back/src/main/resources/application.yml index f788b65..32bba02 100644 --- a/HSLink-back/src/main/resources/application.yml +++ b/HSLink-back/src/main/resources/application.yml @@ -21,4 +21,7 @@ spring: driverClassName: com.mysql.cj.jdbc.Driver ##文件保存路径 -filePath: ${user.dir}\src\main\static\files +# Linux环境下 +filePath: /usr/local/src/phy/file +# Window环境下 +#filePath: ${user.dir}\src\main\static\files