From 22628fca0ec1e95809a11d2b3f08602051901f7e Mon Sep 17 00:00:00 2001 From: Karson Date: Wed, 27 Dec 2023 14:38:17 +0800 Subject: [PATCH] =?UTF-8?q?fieldlist=E7=BB=84=E4=BB=B6=E4=B8=80=E7=BB=B4?= =?UTF-8?q?=E6=95=B0=E7=BB=84=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/assets/js/require-form.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/public/assets/js/require-form.js b/public/assets/js/require-form.js index ed213bac..54a2ff4d 100755 --- a/public/assets/js/require-form.js +++ b/public/assets/js/require-form.js @@ -322,9 +322,14 @@ define(['jquery', 'bootstrap', 'upload', 'validator', 'validator-lang'], functio var result = template ? [] : {}; $.each(data, function (i, j) { if (j) { - if (!template) { - if (j.key != '') { - result[j.key] = j.value; + var keys = Object.keys(j); + if (keys.indexOf("value") > -1 && (keys.length === 1 || (keys.length === 2 && keys.indexOf("key") > -1))) { + if (keys.length === 2) { + if (j.key != '') { + result[j.key] = j.value; + } + } else { + result.push(j.value); } } else { result.push(j);