From 7b9e2cff2a607fcde78f8feff93a69e8e3e798e5 Mon Sep 17 00:00:00 2001 From: ZJY <764763903@qq.com> Date: Sun, 3 Oct 2021 20:20:40 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=90=AF=E7=94=A8=E7=AC=AC=E4=BA=8C?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- models/available.go | 52 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 51 insertions(+), 1 deletion(-) diff --git a/models/available.go b/models/available.go index bdabc69..1e18846 100644 --- a/models/available.go +++ b/models/available.go @@ -242,7 +242,57 @@ func CookieOK(ck *JdCookie) bool { } ui := &UserInfoResult{} if nil != json.Unmarshal(data, ui) { - return true + (&JdCookie{}).Push("第一个接口失效,切换到第二个接口,可能黑IP") + b2 := av2(cookie) + if b2 == false { + if ck.Available == True { + ck.Update(Available, False) + logs.Info(ck.Available) + if Config.Wskey { + if len(ck.WsKey) > 0 { + var pinky = fmt.Sprintf("pin=%s;wskey=%s;", ck.PtPin, ck.WsKey) + msg, err := getKey(pinky) + if err != nil { + logs.Error(err) + } + //JdCookie{}.Push(fmt.Sprintf("自动转换wskey---%s", msg)) + //缺少错误判断 + if strings.Contains(msg, "错误") { + ck.Push(fmt.Sprintf("Wskey失效账号,%s", ck.PtPin)) + (&JdCookie{}).Push(fmt.Sprintf("Wskey失效,%s", ck.PtPin)) + } else { + ptKey := FetchJdCookieValue("pt_key", msg) + ptPin := FetchJdCookieValue("pt_pin", msg) + logs.Info(ptPin) + ck := JdCookie{ + PtKey: ptKey, + PtPin: ptPin, + } + if nck, err := GetJdCookie(ptPin); err == nil { + nck.InPool(ck.PtKey) + msg := fmt.Sprintf("更新账号,%s", ck.PtPin) + (&JdCookie{}).Push(msg) + logs.Info(msg) + } else { + //nck.Update(Available, False) + (&JdCookie{}).Push(fmt.Sprintf("转换失败,%s", nck.PtPin)) + } + } + + } else { + ck.Push(fmt.Sprintf("失效账号,%s", ck.PtPin)) + JdCookie{}.Push(fmt.Sprintf("失效账号,%s", ck.Nickname)) + } + } else { + ck.Push(fmt.Sprintf("失效账号,%s", ck.PtPin)) + JdCookie{}.Push(fmt.Sprintf("失效账号,%s", ck.Nickname)) + } + + } + return false + } else { + return true + } } switch ui.Retcode { case "1001": //ck.BeanNum