fix: timeout仅对checker生效

This commit is contained in:
Mmx
2021-09-29 17:47:39 +08:00
parent 0b52a4efdd
commit ad98aad2d2

View File

@@ -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