From 548a50f98aa6cab54047028417dfbc9511123df6 Mon Sep 17 00:00:00 2001 From: zhangqian <zhangqian@123.com> Date: 星期三, 01 十一月 2023 11:22:43 +0800 Subject: [PATCH] 程序启动时初始化当前设备,选绑定的设备列表第一个 --- main.go | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index b1a14d7..3bc397c 100644 --- a/main.go +++ b/main.go @@ -54,10 +54,11 @@ return } - //浠庢枃浠堕噷璇诲彇褰撳墠鐢熶骇璁惧id - conf.Conf.CurrentDeviceID = service.ReadDeviceIDFromFile() - if conf.Conf.CurrentDeviceID == "" { - conf.Conf.CurrentDeviceID = conf.Conf.System.DeviceId + //浠庢枃浠堕噷璇诲彇褰撳墠鐢熶骇璁惧id鑾峰彇璁惧鍒楄〃绗竴涓� + err := service.InitCurrentDeviceID() + if err != nil { + logx.Errorf("InitCurrentDeviceID error: %v, exit", err) + return } // 鍒ゆ柇褰撳墠闆嗙兢鐘舵�� -- Gitblit v1.8.0