From 56f421e1af4d92d0477dd5e1edad32938e0e3dd0 Mon Sep 17 00:00:00 2001 From: johlanse Date: Wed, 16 Nov 2022 18:26:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=88=90=E7=BB=A9=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/util.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/utils/util.go b/utils/util.go index ba27b68..37043e3 100644 --- a/utils/util.go +++ b/utils/util.go @@ -53,7 +53,10 @@ func CheckUserCookie(cookies []*http.Cookie) (bool, error) { log.Errorln("获取用户总分错误" + err.Error()) return true, err } - if !gjson.GetBytes(response.Bytes(), "ok").Bool() { + log.Infoln(gjson.GetBytes(response.Bytes(), "@this|@pretty")) + if !gjson.GetBytes(response.Bytes(), "ok").Bool() && + gjson.GetBytes(response.Bytes(), "code").Int() == 401 && + gjson.GetBytes(response.Bytes(), "message").String() == "token check failed" { return false, err } return true, err