diff --git a/frontend/src/business/components/api/definition/components/basis/BatchAddParameterButton.vue b/frontend/src/business/components/api/definition/components/basis/BatchAddParameterButton.vue index 33db7a0446..ec4dbd0135 100644 --- a/frontend/src/business/components/api/definition/components/basis/BatchAddParameterButton.vue +++ b/frontend/src/business/components/api/definition/components/basis/BatchAddParameterButton.vue @@ -18,12 +18,24 @@ let params = data.split("\n"); let keyValues = []; params.forEach(item => { - let line = item.split(/,|,/); + let line = item.split(/:|:/); + let values = item.split(line[0] + ":"); let required = false; if (line[1] === '必填' || line[1] === 'Required' || line[1] === 'true') { required = true; } - keyValues.push(new KeyValue({name: line[0], required: required, value: line[2], description: line[3], type: "text", valid: false, file: false, encode: true, enable: true, contentType: "text/plain"})); + keyValues.push(new KeyValue({ + name: line[0], + required: required, + value: values[1], + description: line[3], + type: "text", + valid: false, + file: false, + encode: true, + enable: true, + contentType: "text/plain" + })); }) keyValues.forEach(item => { this.data.unshift(item); diff --git a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue index bf68d9649d..a30461ca99 100644 --- a/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue +++ b/frontend/src/business/components/api/definition/components/request/http/ApiHttpRequestForm.vue @@ -430,12 +430,12 @@ export default { let keyValues = []; params.forEach(item => { let line = item.split(/:|:/); + let values = item.split(line[0] + ":"); let required = false; keyValues.unshift(new KeyValue({ name: line[0], required: required, - value: line[1], - description: line[2], + value: values[1], type: "text", valid: false, file: false, diff --git a/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue b/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue index 6ac098e096..d9280d6fa4 100644 --- a/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue +++ b/frontend/src/business/components/api/test/components/ApiScenarioVariables.vue @@ -110,12 +110,12 @@ export default { let keyValues = []; params.forEach(item => { let line = item.split(/:|:/); + let values = item.split(line[0] + ":"); let required = false; keyValues.unshift(new KeyValue({ name: line[0], required: required, - value: line[1], - description: line[2], + value: values[1], type: "text", valid: false, file: false,