Merge remote-tracking branch 'origin/master'

This commit is contained in:
wenyann 2020-08-04 16:36:36 +08:00
commit 628a99f697
2 changed files with 27 additions and 17 deletions

View File

@ -10,7 +10,7 @@
:placeholder="$t('api_test.variable_name')" show-word-limit/> :placeholder="$t('api_test.variable_name')" show-word-limit/>
</el-col> </el-col>
<el-col> <el-col>
<el-input :disabled="isReadOnly" v-model="item.value" size="small" maxlength="2000" @change="change" <el-input :disabled="isReadOnly" v-model="item.value" size="small" @change="change"
:placeholder="$t('api_test.value')" show-word-limit/> :placeholder="$t('api_test.value')" show-word-limit/>
</el-col> </el-col>
<el-col class="kv-delete"> <el-col class="kv-delete">

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 += '&';
} }
} }