修改成绩查询接口

This commit is contained in:
johlanse 2022-11-16 18:26:44 +08:00
parent b4803e41f5
commit 56f421e1af
1 changed files with 4 additions and 1 deletions

View File

@ -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