证书图片上传

master
薛宇 2 years ago
parent 6cc39f0e6a
commit 20306d4530

@ -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<String, String> 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) {

Loading…
Cancel
Save