fix(接口测试): 旧版 POST 请求query参数及URL中无法使用变量

This commit is contained in:
Captain.B 2021-04-25 09:54:49 +08:00 committed by 刘瑞斌
parent 49cc34b040
commit 57bb0a7a5e
2 changed files with 10 additions and 7 deletions

View File

@ -156,6 +156,8 @@ public class JmeterDocumentParser {
if (!StringUtils.equals("?", u)) { if (!StringUtils.equals("?", u)) {
u += "&"; u += "&";
} }
// 排除 jmeter 内置的函数
if (!v.startsWith("$")) {
v = ScriptEngineUtils.calculate(v); v = ScriptEngineUtils.calculate(v);
// urlencoder // urlencoder
try { try {
@ -163,6 +165,7 @@ public class JmeterDocumentParser {
} catch (UnsupportedEncodingException e) { } catch (UnsupportedEncodingException e) {
LogUtil.error(e); LogUtil.error(e);
} }
}
u += k + "=" + v; u += k + "=" + v;
return u; return u;
}); });

@ -1 +1 @@
Subproject commit e4b1f5838f00791b42b394ad00a365a14f28be83 Subproject commit e7709b9a340394e78610b91105b2cec0f1b8289d