|
|
@ -40,7 +40,7 @@ namespace BBWY.Server.Business |
|
|
|
this.restApiService = restApiService; |
|
|
|
_1688ProductDetailRequestHeader = new Dictionary<string, string>() |
|
|
|
{ |
|
|
|
{ "Host","detail.1688.com"}, |
|
|
|
//{ "Host","detail.1688.com"},
|
|
|
|
{ "User-Agent","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Safari/537.36 Edg/104.0.1293.70"}, |
|
|
|
{ "Accept","text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9"}, |
|
|
|
{ "Accept-Encoding","gzip, deflate, br"}, |
|
|
@ -193,12 +193,13 @@ namespace BBWY.Server.Business |
|
|
|
$"clickid={Guid.NewGuid().ToString().Md5Encrypt()}&sessionid={Guid.NewGuid().ToString().Md5Encrypt()}&sk={(request.PriceMode == Enums.PurchaseOrderMode.批发 ? "order" : "consign")}", |
|
|
|
_1688ProductDetailRequestHeader, |
|
|
|
HttpMethod.Get, |
|
|
|
httpClientName: "gzip"); |
|
|
|
httpClientName: "gzip", |
|
|
|
getResponseHeader: true); |
|
|
|
|
|
|
|
if (_1688pageResult.StatusCode != System.Net.HttpStatusCode.OK) |
|
|
|
return null; |
|
|
|
|
|
|
|
var match = Regex.Match(_1688pageResult.Content, @"(window\.__INIT_DATA=)(.*)(\r*\n*\s*</script>)"); |
|
|
|
var match = Regex.Match(_1688pageResult.Content, @"(window\.__INIT_DATA\s?=)(.*)(\r*\n*\s*</script>)"); |
|
|
|
if (!match.Success) |
|
|
|
return null; |
|
|
|
|
|
|
@ -246,7 +247,7 @@ namespace BBWY.Server.Business |
|
|
|
{ |
|
|
|
PurchaseProductId = request.PurchaseProductId, |
|
|
|
Price = skuPrice == 0M ? firstPrice : skuPrice, |
|
|
|
Title = name, |
|
|
|
Title = matchName, //name
|
|
|
|
PurchaseSkuId = value.Value<string>("skuId"), |
|
|
|
PurchaseSkuSpecId = value.Value<string>("specId"), |
|
|
|
Logo = colorsProperty.FirstOrDefault(c => c.name == matchName)?.imageUrl ?? "pack://application:,,,/Resources/Images/defaultItem.png" |
|
|
|