fix(接口测试): 参数提取过滤默认空行
This commit is contained in:
parent
1ad3fa9186
commit
8f359f95d7
|
@ -512,17 +512,14 @@
|
|||
} from '@/models/apiTest/common';
|
||||
import { ParamsRequestType } from '@/models/projectManagement/commonScript';
|
||||
import { DataSourceItem } from '@/models/projectManagement/environmental';
|
||||
import {
|
||||
RequestConditionProcessor,
|
||||
RequestExtractEnvType,
|
||||
RequestExtractExpressionEnum,
|
||||
RequestExtractExpressionRuleType,
|
||||
RequestExtractResultMatchingRule,
|
||||
RequestExtractScope,
|
||||
ResponseBodyXPathAssertionFormat,
|
||||
} from '@/enums/apiEnum';
|
||||
import { RequestConditionProcessor, RequestExtractExpressionEnum, RequestExtractScope } from '@/enums/apiEnum';
|
||||
|
||||
import { defaultKeyValueParamItem, extractTypeOptions, scriptExampleMap } from '@/views/api-test/components/config';
|
||||
import {
|
||||
defaultExtractParamItem,
|
||||
defaultKeyValueParamItem,
|
||||
extractTypeOptions,
|
||||
scriptExampleMap,
|
||||
} from '@/views/api-test/components/config';
|
||||
|
||||
const { openModal } = useModal();
|
||||
|
||||
|
@ -902,19 +899,6 @@
|
|||
}
|
||||
|
||||
const extractParamsTableRef = ref<InstanceType<typeof paramTable>>();
|
||||
const defaultExtractParamItem: ExpressionConfig = {
|
||||
enable: true,
|
||||
variableName: '',
|
||||
variableType: RequestExtractEnvType.TEMPORARY,
|
||||
extractScope: RequestExtractScope.BODY,
|
||||
expression: '',
|
||||
extractType: RequestExtractExpressionEnum.JSON_PATH,
|
||||
expressionMatchingRule: RequestExtractExpressionRuleType.EXPRESSION,
|
||||
resultMatchingRule: RequestExtractResultMatchingRule.RANDOM,
|
||||
resultMatchingRuleNum: 1,
|
||||
responseFormat: ResponseBodyXPathAssertionFormat.XML,
|
||||
moreSettingPopoverVisible: false,
|
||||
};
|
||||
const fastExtractionVisible = ref(false);
|
||||
const activeRecord = ref({ ...defaultExtractParamItem }); // 用于暂存当前操作的提取参数表格项
|
||||
|
||||
|
|
|
@ -539,6 +539,7 @@
|
|||
casePriorityOptions,
|
||||
caseStatusOptions,
|
||||
defaultBodyParamsItem,
|
||||
defaultExtractParamItem,
|
||||
defaultHeaderParamsItem,
|
||||
defaultKeyValueParamItem,
|
||||
defaultRequestParamsItem,
|
||||
|
@ -1009,6 +1010,8 @@
|
|||
processor.extractParams || [],
|
||||
defaultKeyValueParamItem
|
||||
).validParams;
|
||||
} else if (processor.processorType === RequestConditionProcessor.EXTRACT) {
|
||||
processor.extractors = filterKeyValParams(processor.extractors || [], defaultExtractParamItem).validParams;
|
||||
}
|
||||
return processor;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue