feature:支持使用配置文件,增加网络检查
1、从Config.json读取配置 2、网络正常时跳过登录
This commit is contained in:
10
Util/util.go
10
Util/util.go
@@ -26,11 +26,11 @@ func GetIp(body string) (string, error) {
|
||||
}
|
||||
|
||||
func GetToken(body string) (string, error) {
|
||||
return Search("\"challenge\":\"(.*?)\"",body)
|
||||
return Search("\"challenge\":\"(.*?)\"", body)
|
||||
}
|
||||
|
||||
func GetResult(body string)(string,error){
|
||||
return Search("\"error\":\"(.+?)\"",body)
|
||||
func GetResult(body string) (string, error) {
|
||||
return Search("\"error\":\"(.+?)\"", body)
|
||||
}
|
||||
|
||||
func Md5(content string) string {
|
||||
@@ -39,9 +39,9 @@ func Md5(content string) string {
|
||||
return fmt.Sprintf("%x", w.Sum(nil)) //w.Sum(nil)将w的hash转成[]byte格式
|
||||
}
|
||||
|
||||
func Sha1(content string)string{
|
||||
func Sha1(content string) string {
|
||||
h := sha1.New()
|
||||
h.Write([]byte(content))
|
||||
bs := h.Sum(nil)
|
||||
return fmt.Sprintf("%x\n", bs)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user