From 9904b94153f775d700a13c7972b8ab05fc93a815 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Fri, 6 Jan 2023 18:01:52 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E5=AE=9A=E4=B9=89):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=B5=84=E6=BA=90=E6=B1=A0=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=BA=93=E6=96=87=E4=BB=B6=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=89=A7=E8=A1=8C=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/metersphere/service/ApiJMeterFileService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java b/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java index 9baaf4b9b7..e65541f93a 100644 --- a/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java +++ b/api-test/backend/src/main/java/io/metersphere/service/ApiJMeterFileService.java @@ -307,6 +307,11 @@ public class ApiJMeterFileService { if (CollectionUtils.isNotEmpty(request.getBodyFiles())) { for (BodyFile bodyFile : request.getBodyFiles()) { File file = new File(bodyFile.getName()); + if (!file.exists()) { + // 从MinIO下载 + ApiFileUtil.downloadFile(bodyFile.getId(), bodyFile.getName()); + file = new File(bodyFile.getName()); + } if (file != null && file.exists()) { byte[] fileByte = FileUtils.fileToByte(file); if (fileByte != null) {