diff --git a/test-track/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java b/test-track/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java index d5a9ae6f79..f05cbd5dad 100644 --- a/test-track/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java +++ b/test-track/backend/src/main/java/io/metersphere/excel/listener/TestCaseNoModelDataListener.java @@ -649,8 +649,10 @@ public class TestCaseNoModelDataListener extends AnalysisEventListener stringStream = Arrays.stream(tags.split("[,;,;\"\\r|\\n|\\r\\n\"]")); //当标签值以中英文的逗号和分号分隔时才能正确解析 - List tagList = stringStream.map(tag -> tag = "\"" + tag + "\"") + //当标签值以中英文的逗号和分号分隔时才能正确解析 + Stream stringStream = Arrays.stream(tags.split("[,;,;\"\\r|\\n|\\r\\n\"]")); + //替换非法字符反斜杠"\"为"\\" + List tagList = stringStream.map(tag -> tag = "\"" + tag.replaceAll("\\\\", "\\\\\\\\") + "\"") .collect(Collectors.toList()); String modifiedTags = StringUtils.join(tagList, ","); modifiedTags = "[" + modifiedTags + "]";