build: 更新依赖
This commit is contained in:
@@ -22,12 +22,12 @@ var Daemon = daemon{
|
|||||||
|
|
||||||
// MarkDaemon 写入后台标记文件
|
// MarkDaemon 写入后台标记文件
|
||||||
func (a *daemon) MarkDaemon() error {
|
func (a *daemon) MarkDaemon() error {
|
||||||
return tool.File.Write(a.Path, []byte(a.Mark))
|
return tool.File.WriteAll(a.Path, []byte(a.Mark))
|
||||||
}
|
}
|
||||||
|
|
||||||
// CheckDaemon 检查后台标记文件
|
// CheckDaemon 检查后台标记文件
|
||||||
func (a *daemon) CheckDaemon() bool {
|
func (a *daemon) CheckDaemon() bool {
|
||||||
if data, err := tool.File.Read(a.Path); err != nil {
|
if data, err := tool.File.ReadAll(a.Path); err != nil {
|
||||||
return false
|
return false
|
||||||
} else {
|
} else {
|
||||||
return string(data) == a.Mark
|
return string(data) == a.Mark
|
||||||
|
|||||||
3
go.mod
3
go.mod
@@ -3,8 +3,7 @@ module github.com/Mmx233/BitSrunLoginGo
|
|||||||
go 1.17
|
go 1.17
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Mmx233/config v0.0.3
|
github.com/Mmx233/tool v0.5.9
|
||||||
github.com/Mmx233/tool v0.5.7
|
|
||||||
github.com/howeyc/fsnotify v0.9.0
|
github.com/howeyc/fsnotify v0.9.0
|
||||||
github.com/spf13/viper v1.10.1
|
github.com/spf13/viper v1.10.1
|
||||||
)
|
)
|
||||||
|
|||||||
6
go.sum
6
go.sum
@@ -1,7 +1,5 @@
|
|||||||
github.com/Mmx233/config v0.0.3 h1:E744hob5fWD5P7m7q+91Z41R+Y1LDkxIhQXIeV1tel0=
|
github.com/Mmx233/tool v0.5.9 h1:UNNa+kk0UJHQ3HLG36ZNVsUx9sERR6hJ8UorZpneBeU=
|
||||||
github.com/Mmx233/config v0.0.3/go.mod h1:3mt+LSHUvD/C6tq1ge/Dmp8xKivFmo7gxSihCPjIAi0=
|
github.com/Mmx233/tool v0.5.9/go.mod h1:un5MCoI21lH40fFI5S9++aja8nJb+2sjATak7PnGMZ0=
|
||||||
github.com/Mmx233/tool v0.5.7 h1:KM9CrGenqc48cKop50hBujIfiSPHbPfn2JZ2RhN3A+g=
|
|
||||||
github.com/Mmx233/tool v0.5.7/go.mod h1:un5MCoI21lH40fFI5S9++aja8nJb+2sjATak7PnGMZ0=
|
|
||||||
github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
|
github.com/PuerkitoBio/goquery v1.8.0 h1:PJTF7AmFCFKk1N6V6jmKfrNH9tV5pNE6lZMkG0gta/U=
|
||||||
github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
|
github.com/PuerkitoBio/goquery v1.8.0/go.mod h1:ypIiRMtY7COPGk+I/YbZLbxsxn9g5ejnI2HSMtkjZvI=
|
||||||
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
|
github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ var Checker checker
|
|||||||
|
|
||||||
// NetOk 网络状况检查
|
// NetOk 网络状况检查
|
||||||
func (a *checker) NetOk(transport *http.Transport) bool {
|
func (a *checker) NetOk(transport *http.Transport) bool {
|
||||||
h, i, e := tool.HTTP.GetReader(&tool.GetRequest{
|
res, e := tool.HTTP.GetReader(&tool.GetRequest{
|
||||||
Url: "https://www.baidu.com/",
|
Url: "https://www.baidu.com/",
|
||||||
Redirect: false,
|
Redirect: false,
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
@@ -19,6 +19,6 @@ func (a *checker) NetOk(transport *http.Transport) bool {
|
|||||||
if e != nil {
|
if e != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
_ = i.Close()
|
_ = res.Body.Close()
|
||||||
return h.Get("Location") == ""
|
return res.Header.Get("Location") == ""
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user