diff --git a/pkg/util.go b/pkg/util.go index 278aaec8..f2abcdee 100644 --- a/pkg/util.go +++ b/pkg/util.go @@ -150,7 +150,7 @@ func HttpRequset(urlstring string, method string, postdata string, isredirect bo func Dnslogchek(randomstr string) bool { urlStr := fmt.Sprintf("http://api.ceye.io/v1/records?token=%s&type=dns&filter=%s", CeyeApi, randomstr) if resp, err := HttpRequset(urlStr, "GET", "", false, nil); err == nil { - if !strings.Contains(resp.Body, `"data": []`) { // api返回结果不为空 + if !strings.Contains(resp.Body, `"data": []`) && strings.Contains(resp.Body, `{"code": 200, "message": "OK"}`) { // api返回结果不为空 return true } } @@ -160,7 +160,7 @@ func Dnslogchek(randomstr string) bool { func RandomStr() string { lowercase := "1234567890abcdefghijklmnopqrstuvwxyz" randSource := rand.New(rand.NewSource(time.Now().Unix())) - const ( + var ( letterIdxBits = 6 // 6 bits to represent a letter index letterIdxMask = 1<