From 519c5da10f771504d634d6c3c4456f2c8e979f53 Mon Sep 17 00:00:00 2001 From: baiqi Date: Mon, 14 Oct 2024 16:04:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=88=87=E6=8D=A2=E4=B8=A2=E5=A4=B1schema?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1047484 --user=白奇 在Schema格式下,修改默认的响应内容,在Json中自动生成失败 https://www.tapd.cn/55049933/s/1591564 --- .../components/requestComposition/response/edit.vue | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/src/views/api-test/components/requestComposition/response/edit.vue b/frontend/src/views/api-test/components/requestComposition/response/edit.vue index 7dc48ae68d..289dcb936f 100644 --- a/frontend/src/views/api-test/components/requestComposition/response/edit.vue +++ b/frontend/src/views/api-test/components/requestComposition/response/edit.vue @@ -402,11 +402,18 @@ const selectedKeys = ref([]); watchEffect(() => { - if (activeResponse.value.body.jsonBody.jsonSchema) { + if ( + activeResponse.value.body.jsonBody.jsonSchema && + (!activeResponse.value.body.jsonBody.jsonSchemaTableData || + activeResponse.value.body.jsonBody.jsonSchemaTableData.length === 0) + ) { const { result, ids } = parseSchemaToJsonSchemaTableData(activeResponse.value.body.jsonBody.jsonSchema); activeResponse.value.body.jsonBody.jsonSchemaTableData = result; selectedKeys.value = ids; - } else { + } else if ( + !activeResponse.value.body.jsonBody.jsonSchemaTableData || + activeResponse.value.body.jsonBody.jsonSchemaTableData.length === 0 + ) { activeResponse.value.body.jsonBody.jsonSchemaTableData = []; selectedKeys.value = []; }