From 08030297975519af92123b1ddb4e1a51e5d07730 Mon Sep 17 00:00:00 2001 From: zhouxiaofeng <2946471396@qq.com> Date: Wed, 3 Jun 2026 16:46:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/seal/mixedSignModal.vue | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/views/seal/mixedSignModal.vue b/src/views/seal/mixedSignModal.vue index 4ea5e35..70166b6 100644 --- a/src/views/seal/mixedSignModal.vue +++ b/src/views/seal/mixedSignModal.vue @@ -635,7 +635,11 @@ import { const SUCCESS_CODE = "0000"; const CALLBACK_HOST = "http://47.110.50.12:7005"; -const STORAGE_KEY = "mixed_presign_contract"; +const STORAGE_KEY_PREFIX = "mixed_presign_contract"; +function getStorageKey(record) { + const id = record?.id || record?.contractCode || ""; + return id ? `${STORAGE_KEY_PREFIX}_${id}` : STORAGE_KEY_PREFIX; +} function isSuccessResponse(res) { return String(res?.code || "") === SUCCESS_CODE; @@ -739,6 +743,10 @@ function getBusinessCacheKey(record) { ); } +function getCurrentStorageKey() { + return getStorageKey(businessRecord.value); +} + function updateBusinessStatusByContractStatus(status) { if (!businessRecord.value || status === undefined || status === null) return; businessRecord.value = { @@ -772,7 +780,7 @@ function restoreContractState(saved) { function saveContractState() { try { localStorage.setItem( - STORAGE_KEY, + getCurrentStorageKey(), JSON.stringify({ contractId: contractId.value, contractName: contractName.value, @@ -788,7 +796,7 @@ function saveContractState() { function clearContractState() { try { - localStorage.removeItem(STORAGE_KEY); + localStorage.removeItem(getCurrentStorageKey()); } catch {} } @@ -933,7 +941,8 @@ async function showModal(contractIdParam, businessRecordParam) { if (contextRecord) { try { - const saved = JSON.parse(localStorage.getItem(STORAGE_KEY) || "{}"); + const key = getStorageKey(contextRecord); + const saved = JSON.parse(localStorage.getItem(key) || "{}"); const savedBusinessKey = saved.businessKey || ""; const currentBusinessKey = getBusinessCacheKey(contextRecord); if ( @@ -1035,7 +1044,7 @@ async function loadContract(cid) { } } catch { try { - const saved = JSON.parse(localStorage.getItem(STORAGE_KEY) || "{}"); + const saved = JSON.parse(localStorage.getItem(getCurrentStorageKey()) || "{}"); if (saved.contractId === cid) { restoreContractState(saved); }