fix(接口定义): 修复资源池调用文件库文件无法执行的缺陷

This commit is contained in:
wxg0103 2023-01-06 18:01:52 +08:00 committed by 刘瑞斌
parent fe22603f2c
commit 7ebe481d5e
1 changed files with 5 additions and 0 deletions

View File

@ -307,6 +307,11 @@ public class ApiJMeterFileService {
if (CollectionUtils.isNotEmpty(request.getBodyFiles())) { if (CollectionUtils.isNotEmpty(request.getBodyFiles())) {
for (BodyFile bodyFile : request.getBodyFiles()) { for (BodyFile bodyFile : request.getBodyFiles()) {
File file = new File(bodyFile.getName()); 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()) { if (file != null && file.exists()) {
byte[] fileByte = FileUtils.fileToByte(file); byte[] fileByte = FileUtils.fileToByte(file);
if (fileByte != null) { if (fileByte != null) {