添加京东到家签名转大写!

This commit is contained in:
邹宗楠
2022-03-18 14:08:15 +08:00
parent ef1222df31
commit a6f3978595
7 changed files with 450 additions and 166 deletions

View File

@@ -110,6 +110,7 @@ var (
type PageResultParser func(map[string]interface{}, int) ([]interface{}, int, error)
// 京东签名
func (a *API) signParams(jdParams map[string]interface{}) string {
var keys []string
for k := range jdParams {
@@ -190,7 +191,7 @@ func (a *API) AccessAPI2(apiStr string, jdParams map[string]interface{}, traceIn
err = platformapi.AccessPlatformAPIWithRetry(a.client,
func() *http.Request {
params["timestamp"] = utils.GetCurTimeStr()
sign := a.signParams(params)
sign := strings.ToUpper(a.signParams(params))
params[signKey] = sign
var request *http.Request
if userGet {

View File

@@ -304,7 +304,6 @@ func (a *API) QueryChildCategoriesForOP(pid int64) (catList []*CategoryInfo, err
return nil, err
}
// 新增商家店内分类信息接口
// https://opendj.jd.com/staticnew/widgets/resources.html?groupid=180&apiid=de26f24a62aa47a49e5ab7579d638cb3
func (a *API) AddShopCategory(pid int64, shopCategoryName string, shopCategoryLevel, sort int, userName string) (catId string, err error) {
params := map[string]interface{}{