diff --git a/src-tauri/src/commands/pairing.rs b/src-tauri/src/commands/pairing.rs index 4fdd17c..a2ce2c6 100644 --- a/src-tauri/src/commands/pairing.rs +++ b/src-tauri/src/commands/pairing.rs @@ -44,6 +44,9 @@ pub fn auto_pair_device() -> Result { serde_json::json!({}) }; + // 无论是否已配对,都确保 gateway.controlUi.allowedOrigins 已写入 + patch_gateway_origins(); + // 检查设备是否已配对 if paired.get(&device_id).is_some() { return Ok("设备已配对".into());