diff --git a/frontend/src/business/components/api/definition/ApiDefinition.vue b/frontend/src/business/components/api/definition/ApiDefinition.vue index 7fd8b31554..75288d9376 100644 --- a/frontend/src/business/components/api/definition/ApiDefinition.vue +++ b/frontend/src/business/components/api/definition/ApiDefinition.vue @@ -4,6 +4,8 @@ @@ -284,6 +285,34 @@ export default { projectId() { return getCurrentProjectID(); }, + isSelectDefaultProtocol() { + let selectDefaultProtocol = true; + let routeParamObj = this.$route.params.paramObj; + if (routeParamObj) { + let dataRange = routeParamObj.dataSelectRange; + let dataType = routeParamObj.dataType; + if (dataRange && typeof dataRange === 'string') { + let selectParamArr = dataRange.split("edit:"); + if (selectParamArr.length === 2) { + if (dataType === 'api') { + selectDefaultProtocol = false; + } + } + } + } else { + let dataRange = this.$route.params.dataSelectRange; + let dataType = this.$route.params.dataType; + if (dataRange && typeof dataRange === 'string') { + let selectParamArr = dataRange.split("edit:"); + if (selectParamArr.length === 2) { + if (dataType === 'api') { + selectDefaultProtocol = false; + } + } + } + } + return selectDefaultProtocol; + }, }, components: { 'VersionSelect': VersionSelect.default, @@ -331,6 +360,7 @@ export default { selectNodeIds: [], currentApi: {}, moduleOptions: [], + defaultProtocol: null, trashEnable: false, apiTabs: [{ title: this.$t('api_test.definition.api_title'), @@ -765,6 +795,7 @@ export default { let scenarioId = selectParamArr[1]; if (dataType === 'api') { this.$get('/api/definition/get/' + scenarioId, (response) => { + this.defaultProtocol = response.data.protocol; this.editApi(response.data); }); } @@ -779,6 +810,7 @@ export default { let scenarioId = selectParamArr[1]; if (dataType === 'api') { this.$get('/api/definition/get/' + scenarioId, (response) => { + this.defaultProtocol = response.data.protocol; this.editApi(response.data); }); } diff --git a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue index 1dbaae9b78..1c86d00fe6 100644 --- a/frontend/src/business/components/api/definition/components/complete/BasisApi.vue +++ b/frontend/src/business/components/api/definition/components/complete/BasisApi.vue @@ -1,6 +1,7 @@