diff --git a/platformapi/jdapi/jdapi.go b/platformapi/jdapi/jdapi.go index f8755ca5..d7723e6a 100644 --- a/platformapi/jdapi/jdapi.go +++ b/platformapi/jdapi/jdapi.go @@ -157,12 +157,12 @@ func (a *API) AccessAPI(apiStr string, jdParams map[string]interface{}) (retVal userGet = false } params["jd_param_json"] = jdParamStr - params["timestamp"] = utils.GetCurTimeStr() - sign := a.signParams(params) - params[signKey] = sign err = platformapi.AccessPlatformAPIWithRetry(a.client, func() *http.Request { + params["timestamp"] = utils.GetCurTimeStr() + sign := a.signParams(params) + params[signKey] = sign var request *http.Request if userGet { fullURL := utils.GenerateGetURL(prodURL, apiStr, params) diff --git a/platformapi/platformapi.go b/platformapi/platformapi.go index c08f9e97..7f23b914 100644 --- a/platformapi/platformapi.go +++ b/platformapi/platformapi.go @@ -141,7 +141,7 @@ func AccessPlatformAPIWithRetry(client *http.Client, handleRequest func() *http. var errLevel string bodyMap, err := utils.HTTPResponse2Json(response) if err != nil { - errLevel = ErrLevelGeneralFail //ErrLevelRecoverableErr // 为了配合京东到家排查返回HTML的错误,禁止重试 + errLevel = ErrLevelRecoverableErr // 京东到家偶尔会返回HTML,重试 } else { errLevel, err = handleResponse(bodyMap) }