pdd上货逻辑继续优化 temu选品数据店铺筛选功能

This commit is contained in:
wule committed 2025-09-19 22:55:19 +08:00
1 parent 0e6a034d5f
commit b868c718f0
19 files changed
+562 -271

No files matched your search

+7 -16
View File
@@ -24,6 +24,7 @@ using System.Threading.Tasks;
using System.Windows.Forms;
using Work;
using Work.BLL.Tools;
using TemuKJD.BLL;
namespace TemuKJD.PDDForms.ShopForms
{
@@ -165,7 +166,7 @@ namespace TemuKJD.PDDForms.ShopForms
if (oldShop == null)
{
GlobalConfig.ShopLoginList.Add(newShop);
PDDShopListForm.AddServerPddShop(newShop); // 店铺写入到服务端
ShopBLL.AddServerShop(newShop); // 店铺写入到服务端
}
else
{
@@ -188,12 +189,7 @@ namespace TemuKJD.PDDForms.ShopForms
+ "&shop_account=" + oldShop.ShopAccount;
var result = GetHtml.PostUtf8(url, data);
var urlAddress = BaseClass.BuildObjString("shop/mdy_anti_content");
data = UserLogin.GetSignaturex()
+ "&login_name=" + shop.LoginName
+ "&shop_id=" + shop.ShopId
+ "&anti_contents=" + JsonHelper.SerializeObject(shop.AntiContents);
result = GetHtml.PostUtf8(urlAddress, data);
ShopBLL.MdyAntiContent(oldShop);
}
}
var lstShop = GlobalConfig.ShopLoginList.Where(l => l.LoginName == shop.LoginName).ToList();
@@ -460,28 +456,23 @@ namespace TemuKJD.PDDForms.ShopForms
cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString());
}
int GetAntiContentsTimes = 40;
static int GetAntiContentsTimes = 40;
private void RequestHandler_ResourceLoadComplete(object sender, string url, string postData, string responseData, IRequest request)
{
var antiContent = request.Headers.AllKeys.Contains("Anti-Content") ? request.Headers["Anti-Content"] : "";
if (shop != null && !url.StartsWith("https://mms.pinduoduo.com/janus/api/userinfo") && !string.IsNullOrEmpty(antiContent))
{
GetAntiContentsTimes++;
Invoke(new Action(() => { this.TitleText = "店铺登录 - " + GetAntiContentsTimes; }));
shop.AntiContents.Add(antiContent);
while (shop.AntiContents.Count > 50)
shop.AntiContents.RemoveAt(0);
if (!string.IsNullOrEmpty(shop.ShopId) && GetAntiContentsTimes > 50)
if (!string.IsNullOrEmpty(shop.ShopId) && GetAntiContentsTimes > 500)
{
GetAntiContentsTimes = 0;
var antis = shop.AntiContents;
Task.Run(() =>
{
var urlAddress = BaseClass.BuildObjString("shop/mdy_anti_content");
var data = UserLogin.GetSignaturex()
+ "&login_name=" + shop.LoginName
+ "&shop_id=" + shop.ShopId
+ "&anti_contents=" + JsonHelper.SerializeObject(antis);
var result = GetHtml.PostUtf8(urlAddress, data);
ShopBLL.MdyAntiContent(shop);
});
}
}