fix: timeout仅对checker生效
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user