From 6cd990b24911fadb9b7304e62317d83b2e6306a6 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期一, 13 十一月 2023 19:44:13 +0800
Subject: [PATCH] 调整设备id取值优先级,conf.Conf.System.DeviceId优先级比serf配置高

---
 service/device.go |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/service/device.go b/service/device.go
index e9731cf..f2d8b8a 100644
--- a/service/device.go
+++ b/service/device.go
@@ -58,10 +58,10 @@
 	}
 	if len(deviceList) >= 0 {
 		conf.Conf.CurrentDeviceID = deviceList[0]
-	} else if ServerID != "" {
-		conf.Conf.CurrentDeviceID = ServerID
-	} else {
+	} else if conf.Conf.System.DeviceId != "" {
 		conf.Conf.CurrentDeviceID = conf.Conf.System.DeviceId
+	} else {
+		conf.Conf.CurrentDeviceID = ServerID
 	}
 	SetDeviceIDToFile(conf.Conf.CurrentDeviceID)
 	return nil

--
Gitblit v1.8.0