This commit is contained in:
suyl
2021-07-09 13:35:08 +08:00
parent 91eeb508a2
commit c730727a32
9 changed files with 147 additions and 30 deletions

View File

@@ -99,6 +99,12 @@ func (a *API) AccessStorePage2(fullURL string, bizParams map[string]interface{},
if isPost {
request, _ = http.NewRequest(http.MethodPost, fullURL, strings.NewReader(string(data)))
request.Header.Set("Content-Type", "application/json;charset=UTF-8")
request.Header.Set("Accept", "application/json, text/plain, */*")
request.Header.Set("Accept-Encoding", "gzip, deflate, br")
request.Header.Set("Accept-Language", "zh-CN,zh;q=0.9")
request.Header.Set("Origin", "https://ware.shop.jd.com")
request.Header.Set("Referer", "https://ware.shop.jd.com/rest/storeProduct/view")
request.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.93 Safari/537.36")
} else {
request, _ = http.NewRequest(http.MethodGet, utils.GenerateGetURL(fullURL, "", bizParams), nil)
}
@@ -1122,13 +1128,15 @@ func (a *API) StoreWareDoUpdate(status int, skuId int64, vendorStoreID string) (
//门店商品改价
func (a *API) StoreUpdatePrice(price string, skuId int64, vendorStoreID string) (err error) {
_, err = a.AccessStorePage2("https://ware.shop.jd.com/rest/storeProduct/updateStoreFeature", map[string]interface{}{
params := map[string]interface{}{
"skuId": skuId,
"storeId": vendorStoreID,
"features": map[string]interface{}{
"store_sku_price": price,
},
}, true)
}
data, _ := json.Marshal(params)
_, err = a.AccessStorePage4("https://ware.shop.jd.com/rest/storeProduct/updateStoreFeature", "["+string(data)+"]", true)
return err
}