update
This commit is contained in:
parent
05d2325685
commit
a46f197586
@ -229,7 +229,7 @@ func fetchTokenFromAPI(username, password string) (string, error) {
|
|||||||
var result map[string]interface{}
|
var result map[string]interface{}
|
||||||
json.Unmarshal(body, &result)
|
json.Unmarshal(body, &result)
|
||||||
fmt.Println("code: %d",result["code"])
|
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)
|
fmt.Println(ok)
|
||||||
return "", errors.New("fetchTokenFromAPI:获取token失败,token无效,code:"+fmt.Sprintf("%d", int(result["code"].(float64)))+" message:"+result["message"].(string))
|
return "", errors.New("fetchTokenFromAPI:获取token失败,token无效,code:"+fmt.Sprintf("%d", int(result["code"].(float64)))+" message:"+result["message"].(string))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user