diff --git a/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java b/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java index 30ddb82533..3b1647184a 100644 --- a/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java +++ b/backend/src/main/java/io/metersphere/api/parse/PostmanAbstractParserParser.java @@ -53,12 +53,12 @@ public abstract class PostmanAbstractParserParser extends ApiImportAbstractPa .collect(Collectors.toList()); event.forEach(item -> { PostmanScript script = item.getScript(); - if (script != null) { + if (script != null && item.getListen().contains("prerequest")) { List exec = script.getExec(); if (CollectionUtils.isNotEmpty(exec)) { exec.forEach(col -> { if (StringUtils.isNotEmpty(col)) { - scriptStr.append(col + "/n"); + scriptStr.append(col + "\n"); } }); }