From 933937036dd10307b8d7f507992e92d5ae193c8e Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Thu, 29 Feb 2024 16:24:38 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=80=EF=B8=8F=20fix:=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/combining/index.jsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/components/combining/index.jsx b/src/components/combining/index.jsx index f456eb26..34f6f68a 100644 --- a/src/components/combining/index.jsx +++ b/src/components/combining/index.jsx @@ -82,10 +82,9 @@ const Combining = forwardRef((props, ref) => { useEffect(() => { if (propsData && propsData !== "") { initProps() + } else { + sessionStorage.setItem("knockGoldData", JSON.stringify([])) } - - console.log(sessionStorage.getItem("KeyPcType")) - sessionStorage.setItem("knockGoldData", JSON.stringify([])) }, []) useImperativeHandle(ref, () => ({ @@ -144,7 +143,6 @@ const Combining = forwardRef((props, ref) => { /* 商品提亀 */ async function productSubmit() { const validator = await knockGoldRef.current.submit() - if (validator) { const list = JSON.parse(sessionStorage.getItem("knockGoldData")) const tableData = list.map((item) => { @@ -181,6 +179,7 @@ const Combining = forwardRef((props, ref) => { obj.checked = true return obj }) + sessionStorage.setItem("knockGoldData", JSON.stringify(lj_arr.filter((item) => item.origin))) let arr = map(lj_arr, (res) => { let obj = {}