- 修改AccessPlatformAPIWithRetry接口,允许处理返回结果为非JSON请求
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/hmac"
|
||||
"crypto/sha256"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
"sync"
|
||||
@@ -147,7 +148,10 @@ func (a *API) AccessAPI(action string, params map[string]interface{}, bodyMap ma
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
func(response *http.Response, jsonResult1 map[string]interface{}) (result string, err error) {
|
||||
func(response *http.Response, bodyStr string, jsonResult1 map[string]interface{}) (errLevel string, err error) {
|
||||
if jsonResult1 == nil {
|
||||
return platformapi.ErrLevelRecoverableErr, fmt.Errorf("mapData is nil")
|
||||
}
|
||||
errCode := int(utils.MustInterface2Int64(jsonResult1["errcode"]))
|
||||
if errCode == ResponseCodeSuccess {
|
||||
retVal = jsonResult1
|
||||
|
||||
Reference in New Issue
Block a user