From 9126926d84112900e688c96203ce847ddad410ba Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Sat, 2 Sep 2023 12:50:11 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D1688=E7=88=AC=E8=99=AB?= =?UTF-8?q?=E5=95=86=E5=AE=B6=E5=90=8D=E7=A7=B0=E6=8F=90=E5=8F=96=E8=A7=84?= =?UTF-8?q?=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../PurchaseProductAPIService.cs | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/BBWYB.Server.Business/PurchaseScheme/PurchaseProductAPIService.cs b/BBWYB.Server.Business/PurchaseScheme/PurchaseProductAPIService.cs index 1011e70..fcff95a 100644 --- a/BBWYB.Server.Business/PurchaseScheme/PurchaseProductAPIService.cs +++ b/BBWYB.Server.Business/PurchaseScheme/PurchaseProductAPIService.cs @@ -218,8 +218,24 @@ namespace BBWYB.Server.Business #region 验证purchaserName var purchaserName = jobject["globalData"]["tempModel"]["companyName"].ToString(); if (invalidPurchaserNameList.Contains(purchaserName)) - { - //取 + { + var storeDataMatch = Regex.Match(_1688pageResult.Content, @"(window\.__STORE_DATA=)(.*)(\r*\n*\s*)"); + if (storeDataMatch.Success) + { + try + { + var jsonStr_storeData = storeDataMatch.Groups[2].Value; + var jobject_storeData = JObject.Parse(jsonStr_storeData); + var purchaserName_storeData = jobject_storeData["components"]?["38229149"]?["moduleData"]?["companyName"].ToString(); + if (string.IsNullOrEmpty(purchaserName_storeData)) + purchaserName_storeData = jobject_storeData["components"]?["38229148"]?["moduleData"]?["companyName"].ToString(); + if (string.IsNullOrEmpty(purchaserName_storeData)) + purchaserName_storeData = jobject_storeData["components"]?["38229150"]?["moduleData"]?["companyName"].ToString(); + if (!string.IsNullOrEmpty(purchaserName_storeData)) + purchaserName = purchaserName_storeData; + } + catch { } + } } #endregion