fix(自定义代码片段): 从API定义导入,自动生成的脚本报错
--bug=1007475 --user=lyh 【接口测试】前置脚本-从API定义导入,自动生成的脚本报错了 https://www.tapd.cn/55049933/s/1061715
This commit is contained in:
parent
e48d9d99d2
commit
ac5ff17af5
|
@ -145,7 +145,6 @@ function _beanshellTemplate(obj) {
|
|||
let uri = `new URIBuilder()
|
||||
.setScheme("${protocol}")
|
||||
.setHost("${domain}")
|
||||
.setPort(${port}) // int类型端口
|
||||
.setPath("${requestPath}")
|
||||
`;
|
||||
// http 请求类型
|
||||
|
@ -155,7 +154,15 @@ function _beanshellTemplate(obj) {
|
|||
for (let [k, v] of requestArguments) {
|
||||
uri = uri + `.setParameter("${k}", "${v}")`;
|
||||
}
|
||||
uri = uri + ".build();";
|
||||
if (port) {
|
||||
uri += `.setPort(${port}) // int类型端口
|
||||
`;
|
||||
uri += ` .build();`;
|
||||
} else {
|
||||
uri += `// .setPort(${port}) // int类型端口
|
||||
`;
|
||||
uri += ` .build();`;
|
||||
}
|
||||
// 设置请求头
|
||||
let setHeader = "";
|
||||
for (let [k, v] of requestHeaders) {
|
||||
|
|
Loading…
Reference in New Issue