移除不必要的 localStorage 设置和导航逻辑
This commit is contained in:
@@ -16,8 +16,8 @@ const U1: React.FC = () => {
|
|||||||
const timerRef = useRef<number | null>(null);
|
const timerRef = useRef<number | null>(null);
|
||||||
|
|
||||||
const handleStart = () => {
|
const handleStart = () => {
|
||||||
localStorage.setItem("lastIdCardNo", "31010919571209004X");
|
// localStorage.setItem("lastIdCardNo", "31010919571209004X");
|
||||||
navigate("/u2");
|
// navigate("/u2");
|
||||||
if (reading) return; // 避免重复点击
|
if (reading) return; // 避免重复点击
|
||||||
setReading(true);
|
setReading(true);
|
||||||
// 启动后端监听;如果启动失败立即恢复 UI 状态
|
// 启动后端监听;如果启动失败立即恢复 UI 状态
|
||||||
@@ -64,7 +64,7 @@ const U1: React.FC = () => {
|
|||||||
"info",
|
"info",
|
||||||
`Read IDCard success: ${payload.name} ${payload.id_card_no}`
|
`Read IDCard success: ${payload.name} ${payload.id_card_no}`
|
||||||
);
|
);
|
||||||
// 成功:清理定时器,停止监听,跳转并传递身份证号
|
// 成功:清理定时器,停止监听
|
||||||
if (timerRef.current) {
|
if (timerRef.current) {
|
||||||
clearTimeout(timerRef.current);
|
clearTimeout(timerRef.current);
|
||||||
timerRef.current = null;
|
timerRef.current = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user