fix: 处理合并分支的冲突

This commit is contained in:
Captain.B 2020-08-04 16:20:36 +08:00
parent 4f298c6bb0
commit 4cb0940b28
1 changed files with 26 additions and 16 deletions

View File

@ -1,18 +1,22 @@
import { import {
Element,
TestElement,
HashTree,
TestPlan,
ThreadGroup,
HeaderManager,
HTTPSamplerProxy,
HTTPSamplerArguments,
Arguments, Arguments,
DubboSample,
DurationAssertion, DurationAssertion,
Element,
HashTree,
HeaderManager,
HTTPSamplerArguments,
HTTPSamplerProxy,
JSONPathAssertion,
JSONPostProcessor,
RegexExtractor,
ResponseCodeAssertion, ResponseCodeAssertion,
ResponseDataAssertion, ResponseDataAssertion,
ResponseHeadersAssertion, ResponseHeadersAssertion,
RegexExtractor, JSONPostProcessor, XPath2Extractor, DubboSample, JSONPathAssertion, TestElement,
TestPlan,
ThreadGroup,
XPath2Extractor,
} from "./JMX"; } from "./JMX";
export const uuid = function () { export const uuid = function () {
@ -285,6 +289,11 @@ export class HttpRequest extends Request {
isValid: false, isValid: false,
info: 'api_test.request.please_configure_environment_in_scenario' info: 'api_test.request.please_configure_environment_in_scenario'
} }
} else if (!this.path) {
return {
isValid: false,
info: 'api_test.request.input_path'
}
} }
} else { } else {
if (!this.url) { if (!this.url) {
@ -663,11 +672,12 @@ class JMXHttpRequest {
this.protocol = url.protocol.split(":")[0]; this.protocol = url.protocol.split(":")[0];
this.pathname = this.getPostQueryParameters(request, decodeURIComponent(url.pathname)); this.pathname = this.getPostQueryParameters(request, decodeURIComponent(url.pathname));
} else { } else {
this.port = environment.port; if (environment) {
this.protocol = environment.protocol; this.port = environment.port;
this.domain = environment.domain; this.protocol = environment.protocol;
let url = new URL(environment.protocol + "://" + environment.socket); this.domain = environment.domain;
this.path = this.getPostQueryParameters(request, decodeURIComponent(url.pathname)); }
this.path = this.getPostQueryParameters(request, decodeURIComponent(request.path));
} }
} }
} }
@ -683,8 +693,8 @@ class JMXHttpRequest {
}); });
for (let i = 0; i < parameters.length; i++) { for (let i = 0; i < parameters.length; i++) {
let parameter = parameters[i]; let parameter = parameters[i];
path += (encodeURIComponent(parameter.name) + '=' + encodeURIComponent(parameter.value)); path += (parameter.name + '=' + parameter.value);
if (i !== parameters.length - 1) { if (i != parameters.length - 1) {
path += '&'; path += '&';
} }
} }