From 380d7e9130133af64c969aa2dae836ffda8794ce Mon Sep 17 00:00:00 2001 From: zqm Date: Tue, 7 Apr 2026 16:44:36 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=BB=8E=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E9=87=8C=E6=B2=A1=E6=9C=89=E6=89=BE=E5=88=B0=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E5=8F=B7=E6=88=96=E5=85=B6=E4=B8=BA=E7=A9=BA=EF=BC=8C=E5=88=99?= =?UTF-8?q?=E6=9A=82=E4=B8=8D=E5=8F=91=E9=80=81=E5=91=BD=E4=BB=A4=E3=80=82?= =?UTF-8?q?=E4=BB=85=E7=BB=B4=E6=8C=81=E5=BF=83=E8=B7=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Windows/CS/Framework4.0/Updater/src/main.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Windows/CS/Framework4.0/Updater/src/main.rs b/Windows/CS/Framework4.0/Updater/src/main.rs index 9d3d945..edb6f21 100644 --- a/Windows/CS/Framework4.0/Updater/src/main.rs +++ b/Windows/CS/Framework4.0/Updater/src/main.rs @@ -191,6 +191,14 @@ async fn run_updater(debug_mode: bool) { client.on_first_connect(move |_url, sender| { let device_number = device_number.clone(); Box::pin(async move { + // 仅当有有效的 DeviceNumber 时才发送 GetFileVer 命令 + if device_number.is_empty() || device_number == "UNKNOWN" { + if debug_for_first { + println!("[首次连接] 未配置设备号,仅维持心跳连接"); + } + return; + } + if debug_for_first { println!("[首次连接] 发送 GetFileVer 命令..."); } @@ -236,6 +244,14 @@ async fn run_updater(debug_mode: bool) { client.on_reconnected(move |_url, sender| { let device_number = device_number.clone(); Box::pin(async move { + // 仅当有有效的 DeviceNumber 时才发送 GetFileVer 命令 + if device_number.is_empty() || device_number == "UNKNOWN" { + if debug_for_reconnected { + println!("[重连成功] 未配置设备号,仅维持心跳连接"); + } + return; + } + if debug_for_reconnected { println!("[重连成功] 发送 GetFileVer 命令..."); }