fix(测试跟踪): 自定义字段值为空对象或空数组字符时解析有误

--bug=1024909 --user=宋昌昌 【测试跟踪】github#23178,自定义字段文本框输入{}会自动变为[object Object] https://www.tapd.cn/55049933/s/1356477
This commit is contained in:
song-cc-rock 2023-03-28 15:35:18 +08:00 committed by fit2-zhao
parent 3a7390690e
commit 159fe14f4b
1 changed files with 2 additions and 2 deletions

View File

@ -197,8 +197,8 @@ export function sortCustomFields(customFields) {
let total = 0; //定义total用于控制循环结束
for (let i = 0; total < customFields.length; total++) {
if (
typeof customFields[i].defaultValue === "string" ||
customFields[i].defaultValue instanceof String
(typeof customFields[i].defaultValue === "string" ||
customFields[i].defaultValue instanceof String) && customFields[i].defaultValue !== '{}' && customFields[i].defaultValue !== '[]'
) {
try {
customFields[i].defaultValue = JSON.parse(customFields[i].defaultValue);