chore: 变更util与global层依赖关系

This commit is contained in:
Mmx
2021-11-25 08:37:53 +08:00
parent 884934b951
commit 66df79e68f
7 changed files with 20 additions and 16 deletions

View File

@@ -1,7 +1,6 @@
package util
import (
"github.com/Mmx233/BitSrunLoginGo/global"
"github.com/Mmx233/tool"
"time"
)
@@ -10,11 +9,11 @@ type checker struct{}
var Checker checker
func (checker) NetOk() bool {
func (checker) NetOk(timeout uint) bool {
h, _, e := tool.HTTP.GetBytes(&tool.GetRequest{
Url: "https://www.baidu.com/",
Redirect: false,
Timeout: time.Duration(global.Config.Settings.Timeout) * time.Second,
Timeout: time.Duration(timeout) * time.Second,
})
if e != nil || h.Get("Location") != "" {
return false