1
This commit is contained in:
@@ -245,11 +245,21 @@ func (a *API) AccessAPI3(cmd string, isGet bool, bizParams map[string]interface{
|
||||
// 不管有无错误,都尝试取得数据(因为有出错,但有有效数据返回的情况),比如ecommerce/order/getOrderIdByDaySeq
|
||||
retVal = jsonResult1
|
||||
if errObj, ok := jsonResult1["data"]; ok {
|
||||
errorInfo := errObj.(string)
|
||||
if errorInfo != "ok" {
|
||||
newErr := utils.NewErrorIntCode(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["code"])))
|
||||
return errLevel, newErr
|
||||
switch errObj.(type) {
|
||||
case string:
|
||||
errorInfo := errObj.(string)
|
||||
if errorInfo != "ok" {
|
||||
var newErr *utils.ErrorWithCode
|
||||
if cmd == "bill/list" {
|
||||
newErr = utils.NewErrorIntCode(jsonResult1["error"].(interface{}).(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error"].(interface{}).(map[string]interface{})["code"])))
|
||||
} else {
|
||||
newErr = utils.NewErrorIntCode(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["msg"].(string), int(utils.MustInterface2Int64(jsonResult1["error_list"].([]interface{})[0].(map[string]interface{})["code"])))
|
||||
}
|
||||
return errLevel, newErr
|
||||
}
|
||||
case interface{}:
|
||||
}
|
||||
|
||||
}
|
||||
return platformapi.ErrLevelSuccess, nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user