diff --git a/framework/sdk-parent/frontend/src/utils/custom_field.js b/framework/sdk-parent/frontend/src/utils/custom_field.js index be408edaf9..a53d061303 100644 --- a/framework/sdk-parent/frontend/src/utils/custom_field.js +++ b/framework/sdk-parent/frontend/src/utils/custom_field.js @@ -197,11 +197,13 @@ 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) && customFields[i].defaultValue !== '{}' && customFields[i].defaultValue !== '[]' + (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); + if (typeof JSON.parse(customFields[i].defaultValue) !== "object") { + customFields[i].defaultValue = JSON.parse(customFields[i].defaultValue); + } } catch (e) { // nothing } diff --git a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue index 9d5a2a6910..45ee089d69 100644 --- a/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue +++ b/test-track/frontend/src/business/plan/view/comonents/functional/FunctionalTestCaseEdit.vue @@ -512,7 +512,9 @@ export default { ); this.testCaseTemplate.customFields.forEach((item) => { try { - item.defaultValue = JSON.parse(item.defaultValue); + if (typeof JSON.parse(item.defaultValue) !== "object") { + item.defaultValue = JSON.parse(item.defaultValue); + } } catch (e) { // nothing }