diff --git a/util/checker.go b/util/checker.go index 9ccd125..d8417e4 100644 --- a/util/checker.go +++ b/util/checker.go @@ -1,6 +1,10 @@ package util -import "github.com/Mmx233/tool" +import ( + "autoLogin/global" + "github.com/Mmx233/tool" + "time" +) type checker struct{} @@ -10,6 +14,7 @@ func (checker) NetOk() bool { h, _, e := tool.HTTP.GetBytes(&tool.GetRequest{ Url: "https://www.baidu.com/", Redirect: false, + Timeout: time.Duration(global.Config.Settings.Timeout) * time.Second, }) if e != nil || h.Get("Location") != "" { return false