feature:支持使用配置文件,增加网络检查

1、从Config.json读取配置
2、网络正常时跳过登录
This commit is contained in:
Mmx
2021-03-16 22:51:54 +08:00
parent a273e2673c
commit 56dfeaf4cf
11 changed files with 220 additions and 99 deletions

20
Util/checker.go Normal file
View File

@@ -0,0 +1,20 @@
package Util
import (
"fmt"
"net"
)
type checker struct{}
var Checker checker
func (checker) NetOk() bool {
if ip, err := net.LookupIP("www.msftconnecttest.com"); err != nil {
fmt.Println("a")
return false
} else if len(ip) == 0 || ip[0].String() != "13.107.4.52" {
return false
}
return true
}