Browse Source

Merge remote-tracking branch 'origin/master'

liub 4 tháng trước cách đây
mục cha
commit
5d65ff0846

+ 2 - 2
tenant/insurance/quotation-huatai/src/main/java/com/jzg/quotation/huatai/crawler/util/UploadUtil.java

@@ -119,7 +119,7 @@ public class UploadUtil {
         if (!tempDir.exists()) {
         if (!tempDir.exists()) {
             tempDir.mkdirs();
             tempDir.mkdirs();
         }
         }
-        File originalFile = File.createTempFile(imagesPath + "huatai/" + "upload_temp_" + imgName, ".jpg", tempDir.getAbsoluteFile());
+        File originalFile = File.createTempFile(imagesPath + "huatai/" + "upload_temp_" + imgName, ".jpg", tempDir);
         try (FileOutputStream fos = new FileOutputStream(originalFile)) {
         try (FileOutputStream fos = new FileOutputStream(originalFile)) {
             fos.write(imageBytes);
             fos.write(imageBytes);
         }
         }
@@ -165,7 +165,7 @@ public class UploadUtil {
             img = resizedImg;
             img = resizedImg;
         }
         }
 
 
-        File newFile = new File(imagesPath + "huatai/" + imgName + "new.jpg");
+        File newFile = File.createTempFile(imagesPath + "huatai/" + imgName + "new", ".jpg", tempDir);
         ImageIO.write(img, "jpg", newFile);
         ImageIO.write(img, "jpg", newFile);
 
 
         int newWidth = img.getWidth();
         int newWidth = img.getWidth();