hejianhao
2026-03-25 0d2b9636700ee06f988537d06a9da91eeafa7020
fix: 仅在OTP验证通过后检查热修复状态

避免在未通过OTP验证时发起不必要的热修复状态轮询请求,减少无效网络调用。
1个文件已修改
40 ■■■■■ 已修改文件
src/pages/robotaxi/home/index.tsx 40 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/robotaxi/home/index.tsx
@@ -323,24 +323,28 @@
  });
  useEffect(() => {
    let timer: any = null;
    const check = () => {
      getHotFixInfo().then((res: any) => {
        const status = Number(res?.hotfixStatus);
        if (status === 1) {
          setIsMaintain(true);
          setHotfixEndText(res?.hotfixEndTime);
        } else {
          setIsMaintain(false);
          setHotfixEndText('');
        }
      }).catch(() => { });
    };
    check();
    timer = setInterval(check, 3000);
    return () => {
      if (timer) clearInterval(timer);
    };
    checkOtp(false).then(otp => {
      if (otp) {
        let timer: any = null;
        const check = () => {
          getHotFixInfo().then((res: any) => {
            const status = Number(res?.hotfixStatus);
            if (status === 1) {
              setIsMaintain(true);
              setHotfixEndText(res?.hotfixEndTime);
            } else {
              setIsMaintain(false);
              setHotfixEndText('');
            }
          }).catch(() => { });
        };
        check();
        timer = setInterval(check, 3000);
        return () => {
          if (timer) clearInterval(timer);
        };
      }
    })
  }, []);
  // 监听隐私政策显示状态