diff --git a/frontend/src/components/business/ms-add-attachment/index.vue b/frontend/src/components/business/ms-add-attachment/index.vue index f5f65efc2c..b7bd465b79 100644 --- a/frontend/src/components/business/ms-add-attachment/index.vue +++ b/frontend/src/components/business/ms-add-attachment/index.vue @@ -170,7 +170,6 @@ diff --git a/frontend/src/views/api-test/components/condition/content.vue b/frontend/src/views/api-test/components/condition/content.vue index 1ca58db84e..fd5341fcd5 100644 --- a/frontend/src/views/api-test/components/condition/content.vue +++ b/frontend/src/views/api-test/components/condition/content.vue @@ -244,7 +244,7 @@
@@ -649,7 +650,7 @@ if (!result){ const disabledExpressionSuffix = ref(false); function handleExtractParamTableChange(resultArr: any[], isInit?: boolean) { - condition.value.extractParams = [...resultArr]; + condition.value.extractors = [...resultArr]; if (!isInit) { emit('change'); } @@ -697,13 +698,13 @@ if (!result){ * 提取参数表格-应用更多设置 */ function applyMoreSetting(record: ExpressionConfig) { - condition.value.extractParams = condition.value.extractParams?.map((e) => { + condition.value.extractors = condition.value.extractors?.map((e) => { if (e.id === activeRecord.value.id) { record.moreSettingPopoverVisible = false; return { ...activeRecord.value, moreSettingPopoverVisible: false, - } as any; // TOOD: 这里的后台类型应该是不对的,需要修改 + }; } return e; }); @@ -714,7 +715,7 @@ if (!result){ * 提取参数表格-保存快速提取的配置 */ function handleFastExtractionApply(config: RegexExtract | JSONPathExtract | XPathExtract) { - condition.value.extractParams = condition.value.extractParams?.map((e) => { + condition.value.extractors = condition.value.extractors?.map((e) => { if (e.id === activeRecord.value.id) { return { ...e, @@ -726,7 +727,7 @@ if (!result){ fastExtractionVisible.value = false; nextTick(() => { extractParamsTableRef.value?.addTableLine( - condition.value.extractParams?.findIndex((e) => e.id === activeRecord.value.id) || 0 + condition.value.extractors?.findIndex((e) => e.id === activeRecord.value.id) || 0 ); }); emit('change'); diff --git a/frontend/src/views/api-test/components/condition/index.vue b/frontend/src/views/api-test/components/condition/index.vue index 20630886a3..07b965f3b5 100644 --- a/frontend/src/views/api-test/components/condition/index.vue +++ b/frontend/src/views/api-test/components/condition/index.vue @@ -120,20 +120,23 @@ }, }); break; - // case RequestConditionProcessor.SQL: - // data.value.push({ - // id, - // enableCommonScript: false, - // desc: '', - // enable: true, - // sqlSource: { - // scriptName: '', - // script: '', - // storageType: 'column', - // params: [], - // }, - // }); - // break; + case RequestConditionProcessor.SQL: + data.value.push({ + id, + processorType: RequestConditionProcessor.SQL, + enableCommonScript: false, + description: '', + enable: true, + dataSourceId: '', + environmentId: '', + queryTimeout: 0, + resultVariable: '', + script: '', + variableNames: '', + variables: [], + extractParams: [], + }); + break; case RequestConditionProcessor.TIME_WAITING: data.value.push({ id, diff --git a/frontend/src/views/api-test/components/fastExtraction/index.vue b/frontend/src/views/api-test/components/fastExtraction/index.vue index 7d9d306271..230306abf3 100644 --- a/frontend/src/views/api-test/components/fastExtraction/index.vue +++ b/frontend/src/views/api-test/components/fastExtraction/index.vue @@ -216,12 +216,13 @@ break; case RequestExtractExpressionEnum.JSON_PATH: try { - matchResult.value = JSONPath({ - json: props.response ? JSON.parse(props.response) : '', - path: expressionForm.value.expression, - }); + matchResult.value = + JSONPath({ + json: props.response ? JSON.parse(props.response) : '', + path: expressionForm.value.expression, + }) || []; } catch (error) { - matchResult.value = JSONPath({ json: props.response || '', path: expressionForm.value.expression }); + matchResult.value = JSONPath({ json: props.response || '', path: expressionForm.value.expression }) || []; } break; case RequestExtractExpressionEnum.REGEX: diff --git a/frontend/src/views/api-test/components/fastExtraction/moreSetting.vue b/frontend/src/views/api-test/components/fastExtraction/moreSetting.vue index 9c9eee1d22..2c71e8a3c9 100644 --- a/frontend/src/views/api-test/components/fastExtraction/moreSetting.vue +++ b/frontend/src/views/api-test/components/fastExtraction/moreSetting.vue @@ -5,7 +5,7 @@ {{ t('apiTestDebug.expressionMatchRule') }}
- +
{{ t('apiTestDebug.matchExpression') }} @@ -16,7 +16,7 @@
- +
{{ t('apiTestDebug.matchGroup') }} @@ -34,7 +34,7 @@ {{ t('apiTestDebug.resultMatchRule') }}
- +
{{ t('apiTestDebug.randomMatch') }} @@ -45,7 +45,7 @@
- +
{{ t('apiTestDebug.specifyMatch') }} @@ -56,7 +56,7 @@
- +
{{ t('apiTestDebug.allMatch') }} diff --git a/frontend/src/views/api-test/components/paramTable.vue b/frontend/src/views/api-test/components/paramTable.vue index 6b88012897..6bbbfe2f6f 100644 --- a/frontend/src/views/api-test/components/paramTable.vue +++ b/frontend/src/views/api-test/components/paramTable.vue @@ -111,9 +111,9 @@ @change="(val) => handleTypeChange(val, record, rowIndex, columnConfig.addLineDisabled)" /> -