From 20306d45302d44ef518c68a94457fede1b51d0c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=96=9B=E5=AE=87?= <2433098676@qq.com> Date: Wed, 9 Aug 2023 11:13:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=81=E4=B9=A6=E5=9B=BE=E7=89=87=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/glxp/api/upload/uploadController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/glxp/api/upload/uploadController.java b/src/main/java/com/glxp/api/upload/uploadController.java index ff2bfb1..3afd7d6 100644 --- a/src/main/java/com/glxp/api/upload/uploadController.java +++ b/src/main/java/com/glxp/api/upload/uploadController.java @@ -28,6 +28,10 @@ public class uploadController { @Value("${file_path}") private String filePath; + @Value("${minio_path}") + private String minioPath; + @Value("${minio_url}") + private String minioUrl; /** * 上传PDF模板 @@ -118,13 +122,13 @@ public class uploadController { return ResultVOUtils.error(ResultEnum.DATA_ERROR, "上传文件只能是 .jpg,.png 格式"); } String newName = UUID.randomUUID() + fileType;//生成新文件名 - String savePath = filePath + "/register/file/" + type; + String savePath = minioPath + "/register/file/" + type; String fileFullName = savePath + "/" + newName; try { MinioUtil.uploadFile(fileFullName, file); Map rMap = new HashMap<>(); rMap.put("msg", "上传成功"); - rMap.put("name", fileFullName); + rMap.put("name", minioUrl + fileFullName); rMap.put("type", type); return ResultVOUtils.success(rMap); } catch (Exception e) {