From 5b69fc28a3f2e554210de29dbc8b8c3d49221e94 Mon Sep 17 00:00:00 2001 From: zhangbin <460190368@qq.com> Date: Tue, 2 Sep 2025 15:37:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E6=94=B6=E6=97=A0=E4=BA=BA=E6=9C=BA?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OpenAuth.App/ServiceApp/Algo/DaHuaAiApp.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/OpenAuth.App/ServiceApp/Algo/DaHuaAiApp.cs b/OpenAuth.App/ServiceApp/Algo/DaHuaAiApp.cs index 61435ec..5b8f89e 100644 --- a/OpenAuth.App/ServiceApp/Algo/DaHuaAiApp.cs +++ b/OpenAuth.App/ServiceApp/Algo/DaHuaAiApp.cs @@ -153,9 +153,12 @@ namespace OpenAuth.App.ServiceApp.Algo double lat = 0.0, lng = 0.0; if (drone_info != null) { - var root = JsonNode.Parse(drone_info)?.AsObject(); - lat = root?["data"]?["latitude"]?.GetValue() ?? 0.0; - lng = root?["data"]?["longitude"]?.GetValue() ?? 0.0; + //var root = JsonNode.Parse(drone_info)?.AsObject(); + //lat = root?["data"]?["latitude"]?.GetValue() ?? 0.0; + //lng = root?["data"]?["longitude"]?.GetValue() ?? 0.0; + // 直接访问 dynamic 对象,不需要 Parse + lat = (double?)drone_info.data?.latitude ?? 0.0; + lng = (double?)drone_info.data?.longitude ?? 0.0; } if (info == null) {