From 0390d004b211d907819066a14b6e4682dd90c275 Mon Sep 17 00:00:00 2001 From: lyfO_o <764716047@qq.com> Date: 星期二, 21 二月 2023 10:15:25 +0800 Subject: [PATCH] commit --- src/main/java/com/nanometer/smartlab/controller/UserMngController.java | 2 +- src/main/webapp/WEB-INF/config.properties | 2 ++ src/main/webapp/WEB-INF/spring-mvc.xml | 2 +- src/main/webapp/WEB-INF/test/test.properties | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/nanometer/smartlab/controller/UserMngController.java b/src/main/java/com/nanometer/smartlab/controller/UserMngController.java index 6f95ba8..c9ac88f 100644 --- a/src/main/java/com/nanometer/smartlab/controller/UserMngController.java +++ b/src/main/java/com/nanometer/smartlab/controller/UserMngController.java @@ -581,7 +581,7 @@ InputStream is = file.getInputstream(); String oldName = file.getFileName(); String newName = new Date().getTime() + oldName.substring(oldName.lastIndexOf(".")); - String realPath = personImgPath + "/"; + String realPath = personImgPath; File dest = new File(realPath, newName); if (!dest.getParentFile().exists()) { boolean rel = dest.getParentFile().mkdirs(); diff --git a/src/main/webapp/WEB-INF/config.properties b/src/main/webapp/WEB-INF/config.properties index 2a42b15..0d6e156 100644 --- a/src/main/webapp/WEB-INF/config.properties +++ b/src/main/webapp/WEB-INF/config.properties @@ -59,3 +59,5 @@ message.url = ${message.url} reagent.detail.price.api = ${reagent.detail.price.api} + +personImgPath = ${personImgPath} diff --git a/src/main/webapp/WEB-INF/spring-mvc.xml b/src/main/webapp/WEB-INF/spring-mvc.xml index 00bb5d0..4726456 100644 --- a/src/main/webapp/WEB-INF/spring-mvc.xml +++ b/src/main/webapp/WEB-INF/spring-mvc.xml @@ -55,7 +55,7 @@ </mvc:cors> - <mvc:resources mapping="/upload/**" location="file:///d:/opt/file/smartlab/img/" /> + <mvc:resources mapping="/upload/**" location="file:${personImgPath}" /> <!-- 静态资源(js、image等)的访问 --> <mvc:default-servlet-handler/> </beans> diff --git a/src/main/webapp/WEB-INF/test/test.properties b/src/main/webapp/WEB-INF/test/test.properties index c60c50b..021a362 100644 --- a/src/main/webapp/WEB-INF/test/test.properties +++ b/src/main/webapp/WEB-INF/test/test.properties @@ -12,4 +12,4 @@ institute.copyright= Copyright\u00A92017 \u4E2D\u56FD\u79D1\u5B66\u9662\u82CF\u5DDE\u7EB3\u7C73\u6280\u672F\u4E0E\u7EB3\u7C73\u4EFF\u751F\u7814\u7A76\u6240\u00A0\u82CFICP\u590710220403\u53F7-6 message.url= https://sinanoaq.com:8095/api/sendmessage -personImgPath = file:///d:/opt/file/smartlab/img/ +personImgPath = d:/opt/file/smartlab/img/ -- Gitblit v1.9.2