From 8f2f68dffc5defb59a9f2f4c6ab452aea32b4e97 Mon Sep 17 00:00:00 2001 From: kuaifan Date: Thu, 17 Apr 2025 09:45:48 +0800 Subject: [PATCH] no message --- docker/search/zincsearch/.gitignore | 2 ++ resources/assets/js/functions/common.js | 14 +++++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 docker/search/zincsearch/.gitignore diff --git a/docker/search/zincsearch/.gitignore b/docker/search/zincsearch/.gitignore new file mode 100644 index 000000000..d6b7ef32c --- /dev/null +++ b/docker/search/zincsearch/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/resources/assets/js/functions/common.js b/resources/assets/js/functions/common.js index 6176520c5..7703301e3 100755 --- a/resources/assets/js/functions/common.js +++ b/resources/assets/js/functions/common.js @@ -343,15 +343,19 @@ const timezone = require("dayjs/plugin/timezone"); /** * 克隆对象 - * @param myObj + * @param value + * @param useParse * @returns {*} */ - cloneJSON(myObj) { + cloneJSON(value, useParse = false) { + if (useParse === true) { + return $A.jsonParse($A.jsonStringify(value)) + } try { - return structuredClone(myObj); + return structuredClone(value); } catch (e) { - if (typeof myObj !== 'object' || myObj === null) return myObj; - return $A.jsonParse($A.jsonStringify(myObj)) + if (typeof value !== 'object' || value === null) return value; + return $A.jsonParse($A.jsonStringify(value)) } },