From 4133454e46ac4ee19e1711a6e5fe2c1a2d6d9360 Mon Sep 17 00:00:00 2001 From: gazebo Date: Mon, 2 Dec 2019 18:28:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=84=E7=90=86=E4=BA=AC=E4=B8=9Cpage?= =?UTF-8?q?=E5=9C=A8=E6=9C=89=E4=BA=9Bpost=E8=AF=B7=E6=B1=82=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=BF=94=E5=9B=9E=E7=9A=84=E4=B8=8D=E5=90=8C=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platformapi/jdapi/store_page.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/platformapi/jdapi/store_page.go b/platformapi/jdapi/store_page.go index be99493f..5a8e0da9 100644 --- a/platformapi/jdapi/store_page.go +++ b/platformapi/jdapi/store_page.go @@ -341,9 +341,17 @@ func (a *API) AccessStorePage2(fullURL string, params map[string]interface{}, is return platformapi.ErrLevelSuccess, nil } retVal = jsonResult1 + var errMsg string code, ok := jsonResult1["code"].(string) 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 resultKey != "" { @@ -351,7 +359,7 @@ func (a *API) AccessStorePage2(fullURL string, params map[string]interface{}, is } return platformapi.ErrLevelSuccess, nil } - newErr := utils.NewErrorCode(jsonResult1["msg"].(string), code) + newErr := utils.NewErrorCode(errMsg, code) if _, ok := pageExceedLimitCodes[code]; ok { return platformapi.ErrLevelExceedLimit, newErr } else if _, ok := pageCanRetryCodes[code]; ok {