diff --git a/src/pages/UI7/UI7.tsx b/src/pages/UI7/UI7.tsx index 1b759fe..4ba526e 100644 --- a/src/pages/UI7/UI7.tsx +++ b/src/pages/UI7/UI7.tsx @@ -228,6 +228,7 @@ const UI7: React.FC = () => { useEffect(() => { localStorage.removeItem("consentSignatureList"); + localStorage.removeItem("tongyishuSignedPdfUrls"); }, []); useEffect(() => { @@ -508,6 +509,37 @@ const UI7: React.FC = () => { if (tongyishuRes.Status !== 200) { throw new Error(tongyishuRes.Message || "提交知情同意书签名失败"); } + // 保存签名后的知情同意书 PDF URL(可能返回多个) + try { + const returnedList = Array.isArray( + tongyishuRes.Data?.list_pdf_url + ) + ? tongyishuRes.Data.list_pdf_url + : []; + const urls = returnedList + .map((item) => + typeof item === "string" ? item : item?.pdf_url || "" + ) + .filter((url): url is string => Boolean(url)); + const storedRaw = localStorage.getItem("tongyishuSignedPdfUrls"); + const storedList: string[] = storedRaw ? JSON.parse(storedRaw) : []; + const merged = [...storedList]; + urls.forEach((url) => { + if (!merged.includes(url)) { + merged.push(url); + } + }); + localStorage.setItem( + "tongyishuSignedPdfUrls", + JSON.stringify(merged) + ); + } catch (cacheErr) { + window.electronAPI?.log( + "warn", + `[UI7] 知情同意书 PDF URL 缓存失败: ${(cacheErr as Error).message}` + ); + } + } if (currentStep >= pdfInfoList.length) { diff --git a/src/pages/UI9/UI9.tsx b/src/pages/UI9/UI9.tsx index 9b0a809..70405ad 100644 --- a/src/pages/UI9/UI9.tsx +++ b/src/pages/UI9/UI9.tsx @@ -23,6 +23,7 @@ const UI9: React.FC = () => { localStorage.removeItem("package_code"); localStorage.removeItem("consentSignatureList"); localStorage.removeItem("consentSignature"); + localStorage.removeItem("tongyishuSignedPdfUrls"); navigate("/"); }, [navigate]);