This commit is contained in:
macbook-maxwell 2024-10-08 20:53:12 +08:00
parent 05d2325685
commit a46f197586

View File

@ -229,7 +229,7 @@ func fetchTokenFromAPI(username, password string) (string, error) {
var result map[string]interface{}
json.Unmarshal(body, &result)
fmt.Println("code: %d",result["code"])
if _, ok := result["code"]; !ok || result["code"] != 1 {
if _, ok := result["code"]; !ok || (result["code"] != 1) {
fmt.Println(ok)
return "", errors.New("fetchTokenFromAPI:获取token失败,token无效,code:"+fmt.Sprintf("%d", int(result["code"].(float64)))+" message:"+result["message"].(string))
}