处理京东page在有些post请求时,返回的不同格式
This commit is contained in:
@@ -341,9 +341,17 @@ func (a *API) AccessStorePage2(fullURL string, params map[string]interface{}, is
|
|||||||
return platformapi.ErrLevelSuccess, nil
|
return platformapi.ErrLevelSuccess, nil
|
||||||
}
|
}
|
||||||
retVal = jsonResult1
|
retVal = jsonResult1
|
||||||
|
var errMsg string
|
||||||
code, ok := jsonResult1["code"].(string)
|
code, ok := jsonResult1["code"].(string)
|
||||||
if !ok {
|
if !ok {
|
||||||
return platformapi.ErrLevelGeneralFail, utils.NewErrorCode(utils.Format4Output(jsonResult1, true), "999")
|
if statusMap, ok := jsonResult1["status"].(map[string]interface{}); !ok {
|
||||||
|
return platformapi.ErrLevelGeneralFail, utils.NewErrorCode(utils.Format4Output(jsonResult1, true), "999")
|
||||||
|
} else {
|
||||||
|
code = utils.Interface2String(statusMap["errorCode"])
|
||||||
|
errMsg = utils.Interface2String(statusMap["message"])
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
errMsg = utils.Interface2String(jsonResult1["msg"])
|
||||||
}
|
}
|
||||||
if code == ResponseCodeSuccess {
|
if code == ResponseCodeSuccess {
|
||||||
if resultKey != "" {
|
if resultKey != "" {
|
||||||
@@ -351,7 +359,7 @@ func (a *API) AccessStorePage2(fullURL string, params map[string]interface{}, is
|
|||||||
}
|
}
|
||||||
return platformapi.ErrLevelSuccess, nil
|
return platformapi.ErrLevelSuccess, nil
|
||||||
}
|
}
|
||||||
newErr := utils.NewErrorCode(jsonResult1["msg"].(string), code)
|
newErr := utils.NewErrorCode(errMsg, code)
|
||||||
if _, ok := pageExceedLimitCodes[code]; ok {
|
if _, ok := pageExceedLimitCodes[code]; ok {
|
||||||
return platformapi.ErrLevelExceedLimit, newErr
|
return platformapi.ErrLevelExceedLimit, newErr
|
||||||
} else if _, ok := pageCanRetryCodes[code]; ok {
|
} else if _, ok := pageCanRetryCodes[code]; ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user