From 451981e316234d1d1b7d7b9b26b0cc1a524e1aa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=87?= <2433098676@qq.com> Date: Tue, 15 Aug 2023 11:52:51 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E4=B8=8A=E4=BC=A0=E5=88=B0?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/upload/uploadController.java | 6 ++++-- src/main/resources/application-dev.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/glxp/api/upload/uploadController.java b/src/main/java/com/glxp/api/upload/uploadController.java index f950e22d..e41ddb8c 100644 --- a/src/main/java/com/glxp/api/upload/uploadController.java +++ b/src/main/java/com/glxp/api/upload/uploadController.java @@ -35,6 +35,7 @@ public class uploadController { @Value("${minio_url}") private String minioUrl; + /** * 上传PDF模板 */ @@ -125,8 +126,9 @@ public class uploadController { return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 jpg,png,doc,pdf 格式"); } String newName = UUID.randomUUID() + fileType;//生成新文件名 - String savePath = filePath + "/register/" + type; + String savePath = filePath + "/register/file/" + type; String savePath1 = fileLpath + "?type=" + type; + String fileFullName = savePath + "/" + newName; File file1 = new File(savePath); if (!file1.exists()) {// 判断目录是否存在 @@ -141,7 +143,7 @@ public class uploadController { rMap.put("name", fileUrl + savePath1 + "&name=" + newName); rMap.put("type", type); return ResultVOUtils.success(rMap); - } catch (IOException e) { + } catch (Exception e) { e.printStackTrace(); } return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传失败"); diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index 3b0782df..c57b24dd 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -48,8 +48,8 @@ logging: com.glxp.api.dao: debug file_path: D:/udi/udiwms/udiwmsfile/ -file_url: http://127.0.0.1:9993 file_lpath: /udiwms/image/register/file/getImage +file_url: http://127.0.0.1:9993 minio_path: /udi minio_url: http://139.9.219.60:9000 err_path: d:/udi/udiwms/err/