- 修改AccessPlatformAPIWithRetry接口,允许处理返回结果为非JSON请求
This commit is contained in:
@@ -2,6 +2,7 @@ package xiaowmapi
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"net/http"
|
||||
|
||||
"git.rosy.net.cn/baseapi"
|
||||
@@ -80,7 +81,10 @@ func (a *API) AccessAPI(apiName string, apiParams map[string]interface{}) (retVa
|
||||
return request
|
||||
},
|
||||
a.config,
|
||||
func(response *http.Response, jsonResult1 map[string]interface{}) (errLevel 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")
|
||||
}
|
||||
code := int(utils.Interface2Int64WithDefault(jsonResult1["errno"], ResponseCodeSuccess))
|
||||
if code == ResponseCodeSuccess {
|
||||
retVal = jsonResult1
|
||||
|
||||
Reference in New Issue
Block a user