diff --git a/platformapi/jdshopapi/store_page.go b/platformapi/jdshopapi/store_page.go index c5177229..aaa70aba 100644 --- a/platformapi/jdshopapi/store_page.go +++ b/platformapi/jdshopapi/store_page.go @@ -21,12 +21,13 @@ func (a *API) AccessStorePage(fullURL string, bizParams map[string]interface{}, if isPost { request, _ = http.NewRequest(http.MethodPost, fullURL, strings.NewReader(utils.Map2URLValues(bizParams).Encode())) request.Header.Set("Content-Type", "application/x-www-form-urlencoded") + } else { + request, _ = http.NewRequest(http.MethodGet, utils.GenerateGetURL(fullURL, "", bizParams), nil) 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("referer", "https://stores.shop.jd.com/") - } else { - request, _ = http.NewRequest(http.MethodGet, utils.GenerateGetURL(fullURL, "", bizParams), nil) + request.Header.Set("user-agent", "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/77.0.3865.120 Safari/537.36") } a.FillRequestCookies(request) return request