From 86ed42f0b9fa858f64594a16c253fa14b2b2ba74 Mon Sep 17 00:00:00 2001 From: yuchenglong Date: Tue, 20 Jan 2026 11:28:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20IDCard=20=E8=AF=BB?= =?UTF-8?q?=E5=8F=96=E6=97=A5=E5=BF=97=E6=A0=BC=E5=BC=8F=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/U1/u1.tsx | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/pages/U1/u1.tsx b/src/pages/U1/u1.tsx index 84b770f..ea5ecfc 100644 --- a/src/pages/U1/u1.tsx +++ b/src/pages/U1/u1.tsx @@ -51,7 +51,7 @@ const U1: React.FC = () => { window.electronAPI.log("info", `[idcard-data] received`); window.electronAPI.log( "info", - `Read IDCard success: ${payload.name} ${payload.id_card_no}` + `Read IDCard success: ${payload.name} ${payload.id_card_no}`, ); // 清理倒计时 @@ -75,7 +75,7 @@ const U1: React.FC = () => { .catch((e: any) => console.error(e)); }, 1000); }) - .catch(() => { }); + .catch(() => {}); }; // 先验证档案信息,查询到才跳转 @@ -92,13 +92,15 @@ const U1: React.FC = () => { .then((res) => { if (res.Status === 200 && res.Data) { // 查询成功,跳转到 u2 - window.electronAPI.stopIdCardListen().catch(() => { }); + window.electronAPI.stopIdCardListen().catch(() => {}); setReading(false); isProcessingRef.current = false; navigate("/u2"); } else { // 未查询到档案信息,显示错误提示,不跳转 - setErrorMsg("未查询到您的档案信息,详情请咨询前台工作人员!"); + setErrorMsg( + res.Message || "未查询到您的档案信息,详情请咨询前台工作人员!", + ); setReading(false); isProcessingRef.current = false; resetListening(); @@ -119,7 +121,7 @@ const U1: React.FC = () => { }); return () => { - window.electronAPI.stopIdCardListen().catch(() => { }); + window.electronAPI.stopIdCardListen().catch(() => {}); window.electronAPI.removeIdCardListeners(); if (timerRef.current) clearTimeout(timerRef.current); if (intervalRef.current) clearInterval(intervalRef.current);