fix: patch_gateway_origins 移至 paired 检查前,修复已配对设备跳过写入 origins 的 bug

This commit is contained in:
晴天
2026-03-04 14:09:45 +08:00
parent 8ced48be4c
commit 7a05625aee

View File

@@ -44,6 +44,9 @@ pub fn auto_pair_device() -> Result<String, String> {
serde_json::json!({})
};
// 无论是否已配对,都确保 gateway.controlUi.allowedOrigins 已写入
patch_gateway_origins();
// 检查设备是否已配对
if paired.get(&device_id).is_some() {
return Ok("设备已配对".into());