From 019134c072f263304e45dc3db092c1d7242cdb6b Mon Sep 17 00:00:00 2001 From: zhangzengfei <zhangzengfei@smartai.com> Date: 星期日, 21 四月 2024 23:45:53 +0800 Subject: [PATCH] 处理设备名为空的bug --- service/nvcs.go | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/service/nvcs.go b/service/nvcs.go index 7882db5..455b7c8 100644 --- a/service/nvcs.go +++ b/service/nvcs.go @@ -6,6 +6,7 @@ "fmt" "io/ioutil" "net" + "strings" "gat1400Exchange/config" "gat1400Exchange/models" @@ -90,6 +91,11 @@ } elevator := data.Elevator[0] + elevator.Name = strings.Trim(elevator.Name, " ") + if elevator.Name == "" { + continue + } + var d = models.Device{ Id: elevator.Name, Pos: elevator.Status.FloorName, -- Gitblit v1.8.0