diff --git a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java index 59d3770e67..40a28ec10e 100644 --- a/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java +++ b/backend/src/main/java/io/metersphere/api/dto/definition/request/sampler/MsHTTPSamplerProxy.java @@ -397,7 +397,7 @@ public class MsHTTPSamplerProxy extends MsTestElement { url = url.replace(this.getPort(), "10990"); } try { - if (StringUtils.startsWithAny(url, "http://", "https://")) { + if (!StringUtils.startsWithAny(url, "http://", "https://")) { url = "http://" + url; } URL urlObject = new URL(url); diff --git a/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue b/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue index 8ba1296ce5..a57a0502e2 100644 --- a/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue +++ b/frontend/src/business/components/api/definition/components/ApiVariableAdvance.vue @@ -227,566 +227,566 @@ diff --git a/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue b/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue index 4062b919e9..06423f0ecc 100644 --- a/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue +++ b/frontend/src/business/components/api/test/components/ApiVariableAdvance.vue @@ -36,7 +36,7 @@ - +

{{ $t('api_test.environment.environment') }}

@@ -45,7 +45,7 @@

{{ $t('api_test.scenario.scenario') }}

-
+

{{ $t('api_test.request.parameters_pre_request') }}

@@ -53,7 +53,8 @@

{{ $t('api_test.request.jmeter_func') }}

- + @@ -63,24 +64,27 @@ - - - - -
- - - - {{ $t('commons.save') }} - - - {{ $t('api_test.request.parameters_advance_add_func') }} - - - {{ $t('api_test.request.parameters_preview') }} - + + +
+ + + + + + + {{ $t('commons.save') }} + + + {{ $t('api_test.request.parameters_advance_add_func') }} + + + {{ $t('api_test.request.parameters_preview') }} + + + +
{{ itemValuePreview }}
@@ -255,14 +259,14 @@ export default { let index = this.mockVariableFuncs.indexOf(itemFunc); this.mockVariableFuncs = this.mockVariableFuncs.slice(0, index); this.mockVariableFuncs.push({name: '', params: []}); - let valindex = this.itemValue.indexOf('|'+func.name); - this.itemValue = this.itemValue.slice(0,valindex); - }else { + let valindex = this.itemValue.indexOf('|' + func.name); + this.itemValue = this.itemValue.slice(0, valindex); + } else { this.methodChange(itemFunc, func); } }, addFunc() { - if (this.itemValue.indexOf('@') == -1) { + if (this.currentTab === 0 && this.itemValue.indexOf('@') == -1) { this.itemValue = '@' + this.itemValue; } else { this.itemValue = this.itemValue; @@ -289,7 +293,7 @@ export default { this.mockVariableFuncs.push({name: '', params: []}); }, saveAdvanced() { - if (this.itemValue.indexOf('@') == -1) { + if (this.currentTab === 0 && this.itemValue.indexOf('@') == -1) { this.currentItem.value = '@' + this.itemValue; } else { this.currentItem.value = this.itemValue; @@ -298,7 +302,12 @@ export default { this.mockVariableFuncs = []; this.$emit('advancedRefresh', this.currentItem.value); - } + }, + handleRowClick(row) { + if (row && row.name) { + this.itemValue = row.name; + } + }, } } diff --git a/frontend/src/business/components/api/test/components/environment/ApiScenarioVariables.vue b/frontend/src/business/components/api/test/components/environment/ApiScenarioVariables.vue index 20981239fb..a7e0c64e5c 100644 --- a/frontend/src/business/components/api/test/components/environment/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/test/components/environment/ApiScenarioVariables.vue @@ -54,15 +54,15 @@ - + - +