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/