fix(接口测试): 请求体代码切换问题修复

This commit is contained in:
baiqi 2024-08-20 16:28:00 +08:00 committed by Craftsman
parent 9157039201
commit bb0942ae74
1 changed files with 6 additions and 6 deletions

View File

@ -481,20 +481,20 @@
const currentBodyCode = computed({
get() {
if (innerParams.value.bodyType === RequestBodyFormat.JSON) {
return innerParams.value.jsonBody.jsonValue;
return innerParams.value.jsonBody.jsonValue || '';
}
if (innerParams.value.bodyType === RequestBodyFormat.XML) {
return innerParams.value.xmlBody.value;
return innerParams.value.xmlBody.value || '';
}
return innerParams.value.rawBody.value;
return innerParams.value.rawBody.value || '';
},
set(val) {
if (innerParams.value.bodyType === RequestBodyFormat.JSON) {
innerParams.value.jsonBody.jsonValue = val;
innerParams.value.jsonBody.jsonValue = val || '';
} else if (innerParams.value.bodyType === RequestBodyFormat.XML) {
innerParams.value.xmlBody.value = val;
innerParams.value.xmlBody.value = val || '';
} else {
innerParams.value.rawBody.value = val;
innerParams.value.rawBody.value = val || '';
}
},
});