From 6034f27ed1da1febdcbc0bc0ff17bd7f5b7528ac Mon Sep 17 00:00:00 2001 From: fit2-zhao Date: Tue, 19 Sep 2023 10:47:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96=E6=AD=A3=E5=88=99=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=A7=84=E5=88=99=20#26797?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fit2-zhao --- .../api/dto/definition/request/extract/MsExtract.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java index c2b63a2d55..babad81943 100644 --- a/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java +++ b/api-test/backend/src/main/java/io/metersphere/api/dto/definition/request/extract/MsExtract.java @@ -96,7 +96,8 @@ public class MsExtract extends MsTestElement { if (extractRegex.isMultipleMatching()) { extractor.setMatchNumber(-1); } - extractor.setTemplate("$1$"); + // $1$提取 JSON 响应中的第一个匹配项 $0$用于提取整个 JSON 响应 + extractor.setTemplate("$0$"); extract.add(extractor.getRefName()); return extractor;