From 262f012860d1b85a582e91af4c8855c3f33c303a Mon Sep 17 00:00:00 2001 From: Mmx233 Date: Sat, 10 Dec 2022 16:54:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A4=E6=96=AD=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E4=BD=BF=E7=94=A8=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- v1/login.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/v1/login.go b/v1/login.go index d667617..ec99838 100644 --- a/v1/login.go +++ b/v1/login.go @@ -29,8 +29,13 @@ func LoginStatus(c *Conf) (online bool, ip string, e error) { } // 如果深澜分配的 ip 不是内网 ip,说明已经在线且拥有固定 ip + ip = ipInterface.(string) + inet := strings.HasPrefix(ip, "192.168.") || strings.HasPrefix(ip, "10.") || strings.HasPrefix(ip, "172.") - return err.(string) == "ok" || !inet, ipInterface.(string), nil + + online = err.(string) == "ok" || !inet + + return } func DoLogin(clientIP string, c *Conf) error {