This commit is contained in:
macbook-maxwell 2024-10-08 20:15:31 +08:00
parent f0921f8d4c
commit e22213e299

View File

@ -226,7 +226,7 @@ func fetchTokenFromAPI(username, password string) (string, error) {
var result map[string]interface{}
json.Unmarshal(body, &result)
if _, ok := result["code"]; !ok || result["code"] != 1 {
return "", errors.New("获取token失败,token无效")
return "", errors.New("fetchTokenFromAPI:获取token失败,token无效,code:"+result["code"]+" message:"+result["message"])
}
// 如果不存在message字段或message字段的值为空则token为空
if _, ok := result["message"]; !ok || result["message"] == "" {