附件上传接口修改

master
bmpandlcm 1 year ago
parent 33b4c00788
commit bd32e88586

@ -87,6 +87,8 @@ public class FileUploadController {
LogUtil.WriteLog_Info("附件开始上传到服务器===========" + PubTools.getCurrentDate(), "FileUploadController");
FileUtils.writeByteArrayToFile(file, imageBytes);
LogUtil.WriteLog_Info("附件上传到服务器结束===========" + PubTools.getCurrentDate(), "FileUploadController");
} else if ("-9999".equals(addWaterImage)) {
throw new Exception("附件添加水印失败");
}
}
LogUtil.WriteLog_Info("附件上传接口执行结束===========" + PubTools.getCurrentDate(), "FileUploadController");

@ -40,6 +40,9 @@ public class ImageUtils {
imageBase64 = imageBase64.replaceAll(" ", "+").replace("\r\n", "");
byte[] imageBytes = Base64.getDecoder().decode(imageBase64);
// 构造 BufferedImage 对象
if (PubTools.isEmpty(imageBytes)) {
return "-9999";
}
inputStream = new ByteArrayInputStream(imageBytes);
BufferedImage bufferedImage1 = ImageIO.read(inputStream);
LogUtil.WriteLog_Info("ImageUtils====附件地址urlfileAddress=====" + fileAddress, "FileController");

Loading…
Cancel
Save