This commit is contained in:
邹宗楠
2023-04-23 15:44:48 +08:00
parent 76fb7fc028
commit 61d9da631c
8 changed files with 75 additions and 17 deletions

View File

@@ -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
})