美团外卖API,不管有无错误,都尝试取得数据(因为有出错,但有有效数据返回的情况),比如ecommerce/order/getOrderIdByDaySeq
This commit is contained in:
@@ -169,6 +169,12 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
if jsonResult1 == nil {
|
||||
return platformapi.ErrLevelRecoverableErr, fmt.Errorf("mapData is nil")
|
||||
}
|
||||
// 不管有无错误,都尝试取得数据(因为有出错,但有有效数据返回的情况),比如ecommerce/order/getOrderIdByDaySeq
|
||||
if resultKey != "" {
|
||||
retVal = jsonResult1[resultKey]
|
||||
} else {
|
||||
retVal = jsonResult1
|
||||
}
|
||||
if errObj, ok := jsonResult1["error"]; ok {
|
||||
baseapi.SugarLogger.Debugf("mtwm AccessAPI failed, jsonResult1:%s", utils.Format4Output(jsonResult1, true))
|
||||
errorInfo := errObj.(map[string]interface{})
|
||||
@@ -179,10 +185,6 @@ func (a *API) AccessAPI2(cmd string, isGet bool, bizParams map[string]interface{
|
||||
return platformapi.ErrLevelRecoverableErr, newErr
|
||||
}
|
||||
return platformapi.ErrLevelCodeIsNotOK, newErr
|
||||
} else if resultKey != "" {
|
||||
retVal = jsonResult1[resultKey]
|
||||
} else {
|
||||
retVal = jsonResult1
|
||||
}
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user