- refactor platformapi.AccessPlatformAPIWithRetry
This commit is contained in:
@@ -146,11 +146,7 @@ func (a *API) AccessAPI(action string, params map[string]interface{}, body strin
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
func(response *http.Response) (result string, err error) {
|
||||
jsonResult1, err := utils.HTTPResponse2Json(response)
|
||||
if err != nil {
|
||||
return platformapi.ErrLevelGeneralFail, platformapi.ErrResponseDataFormatWrong
|
||||
}
|
||||
func(jsonResult1 map[string]interface{}) (result string, err error) {
|
||||
var errInfo *ErrorInfo
|
||||
// 微信的返回值,在错误与正常情况下,结构是完全不一样的
|
||||
if errCode, ok := jsonResult1["errcode"]; ok {
|
||||
|
||||
Reference in New Issue
Block a user