fix(接口定义): 修复测试页面生成测试数据类型错误的缺陷

--bug=1020077 --user=王孝刚
【接口测试】接口定义-TEST页面,生成测试数据,默认值会带引号,number值会变成string
https://www.tapd.cn/55049933/s/1302381
This commit is contained in:
wxg0103 2022-11-23 11:52:23 +08:00 committed by wxg0103
parent 66078702c4
commit 2575f7d887
4 changed files with 18 additions and 0 deletions

View File

@ -548,6 +548,15 @@ export default {
if (item.delay) { if (item.delay) {
item.delay = Number(item.delay); item.delay = Number(item.delay);
} }
if (item.disabled || !item.disabled) {
delete item.disabled;
}
if (!item.environmentEnable || item.environmentEnable) {
delete item.environmentEnable;
}
if (item.refEevMap) {
delete item.refEevMap;
}
if (item.body && item.body.kvs) { if (item.body && item.body.kvs) {
item.body.kvs.forEach((v) => { item.body.kvs.forEach((v) => {
if (v.files) { if (v.files) {

View File

@ -159,6 +159,9 @@ export default {
}, },
assignKey(to, from, key) { assignKey(to, from, key) {
if (key === 'type') {
return;
}
let val = from[key]; let val = from[key];
if (val === undefined || val === null) { if (val === undefined || val === null) {
return; return;

View File

@ -138,6 +138,9 @@ export default {
}, },
assignKey(to, from, key) { assignKey(to, from, key) {
if (key === 'type') {
return;
}
let val = from[key]; let val = from[key];
if (val === undefined || val === null) { if (val === undefined || val === null) {
return; return;

View File

@ -542,6 +542,9 @@ export default {
}, },
assignKey(to, from, key) { assignKey(to, from, key) {
if (key === 'type') {
return;
}
let val = from[key]; let val = from[key];
if (val === undefined || val === null) { if (val === undefined || val === null) {