From 28d311e7593eeb7eccae44b12d67f47c0a8339cb Mon Sep 17 00:00:00 2001 From: UlricQin Date: Tue, 22 Dec 2020 11:56:20 +0800 Subject: [PATCH] =?UTF-8?q?bugfix=20sql=20=E6=B3=A8=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/ams/http/router_host.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/ams/http/router_host.go b/src/modules/ams/http/router_host.go index 99cf2933..333ac33e 100644 --- a/src/modules/ams/http/router_host.go +++ b/src/modules/ams/http/router_host.go @@ -271,7 +271,12 @@ func v1HostRegister(c *gin.Context) { oldFields[k] = v } - uniqValue := f.SN + uniqValue := "" + + if f.UniqKey == "sn" { + uniqValue = f.SN + } + if f.UniqKey == "ip" { uniqValue = f.IP }