拼多多商品获取逻辑

This commit is contained in:
wule committed 2025-09-11 19:06:16 +08:00
1 parent 840636d5c9
commit 6639224771
68 files changed
+7132 -692

No files matched your search

+5 -5
View File
@@ -30,7 +30,7 @@
{
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("超级店铺管理");
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("超级用户管理");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("选品数据库");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("产品数据库");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("选品加价管理");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("认领待上传");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("库存上传");
@@ -137,8 +137,8 @@
treeNode1.Text = "超级店铺管理";
treeNode2.Name = "超级用户管理";
treeNode2.Text = "超级用户管理";
treeNode3.Name = "选品数据库";
treeNode3.Text = "选品数据库";
treeNode3.Name = "产品数据库";
treeNode3.Text = "产品数据库";
treeNode4.Name = "选品加价管理";
treeNode4.Text = "选品加价管理";
treeNode5.Name = "认领待上传";
@@ -156,14 +156,14 @@
this.tv.TabIndex = 1;
this.tv.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.tv_AfterSelect);
//
// AdminForm
// PDDAdminForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(933, 446);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.Name = "AdminForm";
this.Name = "PDDAdminForm";
this.Text = "AdminForm";
this.Load += new System.EventHandler(this.ShopForm_Load);
this.panel1.ResumeLayout(false);
+14 -13
View File
@@ -10,6 +10,7 @@ using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.PDDForms.ProductSelectForms;
//using TemuKJD.KJDForms.ProductSelectForms;
//using TemuKJD.KJDForms.ProductThirdSelectForms;
@@ -19,7 +20,7 @@ namespace TemuKJD.PDDForms.AdminForms
{
public Lazy<PDDAdminAccountForm> adminAccountForm = new Lazy<PDDAdminAccountForm>();
public Lazy<PDDAdminShopListForm> adminShopForm = new Lazy<PDDAdminShopListForm>();
//public Lazy<DbProductListForm> dbProductListForm = new Lazy<DbProductListForm>();
public Lazy<PDDDBProdListForm> dbProdListForm = new Lazy<PDDDBProdListForm>();
//public Lazy<DbPriceMarkUpForm> dbPriceMarkUpForm = new Lazy<DbPriceMarkUpForm>();
//public Lazy<DbProductSelectListManageForm> dbProductSelectListManageForm = new Lazy<DbProductSelectListManageForm>();
//public Lazy<ProductThirdSelectListManageForm> productThirdSelectListManageForm = new Lazy<ProductThirdSelectListManageForm>();
@@ -34,7 +35,7 @@ namespace TemuKJD.PDDForms.AdminForms
tv.SelectedNode = tv.Nodes[0].Nodes[0];
tv.ExpandGroup(tv.Nodes[0].Name);
List<string> hideName = new List<string>() { "超级用户管理", "超级店铺管理", "选品数据库", "选品加价管理", "认领待上传", "库存上传", "商品核价" };
List<string> hideName = new List<string>() { "超级用户管理", "超级店铺管理", "产品数据库", "选品加价管理", "认领待上传", "库存上传", "商品核价" };
if (BaseClass.GroupId == 3)
{
@@ -43,18 +44,18 @@ namespace TemuKJD.PDDForms.AdminForms
{
hideName.Remove("超级用户管理");
hideName.Remove("超级店铺管理");
hideName.Remove("选品数据库");
hideName.Remove("选品加价管理");
hideName.Remove("认领待上传");
hideName.Remove("库存上传");
hideName.Remove("商品核价");
hideName.Remove("产品数据库");
//hideName.Remove("选品加价管理");
//hideName.Remove("认领待上传");
//hideName.Remove("库存上传");
//hideName.Remove("商品核价");
}
if (BaseClass.SaLevel==2)
{
hideName.Remove("超级店铺管理");
hideName.Remove("认领待上传");
hideName.Remove("库存上传");
hideName.Remove("商品核价");
//hideName.Remove("认领待上传");
//hideName.Remove("库存上传");
//hideName.Remove("商品核价");
}
}
@@ -87,9 +88,9 @@ namespace TemuKJD.PDDForms.AdminForms
case "超级店铺管理":
SetForm(adminShopForm.Value);
break;
//case "选品数据库":
// SetForm(dbProductListForm.Value);
// break;
case "产品数据库":
SetForm(dbProdListForm.Value);
break;
//case "选品加价管理":
// SetForm(dbPriceMarkUpForm.Value);
// break;
+82 -81
View File
@@ -29,11 +29,11 @@ namespace TemuKJD.PDDForms.AdminForms
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel();
this.panel5 = new System.Windows.Forms.Panel();
@@ -57,12 +57,16 @@ namespace TemuKJD.PDDForms.AdminForms
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.pnlAddProdRemaining = new System.Windows.Forms.Panel();
this.lblShopId = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
this.pnlCancel = new DevComponents.DotNetBar.PanelEx();
this.numAddRemaining = new System.Windows.Forms.NumericUpDown();
this.btnRemainOK = new DevComponents.DotNetBar.PanelEx();
this.lblAddProdRemaining = new System.Windows.Forms.Label();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -92,10 +96,6 @@ namespace TemuKJD.PDDForms.AdminForms
this.colSubSa = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.lblShopId = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -413,6 +413,16 @@ namespace TemuKJD.PDDForms.AdminForms
this.pnlAddProdRemaining.TabIndex = 7;
this.pnlAddProdRemaining.Visible = false;
//
// lblShopId
//
this.lblShopId.AutoSize = true;
this.lblShopId.Location = new System.Drawing.Point(20, 19);
this.lblShopId.Name = "lblShopId";
this.lblShopId.Size = new System.Drawing.Size(50, 17);
this.lblShopId.TabIndex = 455;
this.lblShopId.Text = "ShopId";
this.lblShopId.Visible = false;
//
// panel2
//
this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top;
@@ -497,19 +507,19 @@ namespace TemuKJD.PDDForms.AdminForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvShop.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvShop.BackgroundColor = System.Drawing.Color.White;
this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -552,6 +562,43 @@ namespace TemuKJD.PDDForms.AdminForms
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
this.dgvShop.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvShop_CellMouseDown);
//
// chkAutoDrag
//
this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.chkAutoDrag.AutoSize = true;
this.chkAutoDrag.BackColor = System.Drawing.Color.White;
this.chkAutoDrag.Location = new System.Drawing.Point(597, 0);
this.chkAutoDrag.Name = "chkAutoDrag";
this.chkAutoDrag.Size = new System.Drawing.Size(159, 21);
this.chkAutoDrag.TabIndex = 3;
this.chkAutoDrag.Text = "登录时自动滑动拼图验证";
this.chkAutoDrag.UseVisualStyleBackColor = false;
this.chkAutoDrag.Visible = false;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(911, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(362, 25);
this.ucSplitPage1.TabIndex = 4;
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1273, 25);
this.statusBar.TabIndex = 1;
//
// colSelect
//
this.colSelect.FillWeight = 26F;
@@ -589,8 +636,8 @@ namespace TemuKJD.PDDForms.AdminForms
//
// colMinus
//
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colMinus.DefaultCellStyle = dataGridViewCellStyle8;
dataGridViewCellStyle3.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colMinus.DefaultCellStyle = dataGridViewCellStyle3;
this.colMinus.FillWeight = 15F;
this.colMinus.HeaderText = "-";
this.colMinus.Name = "colMinus";
@@ -599,8 +646,8 @@ namespace TemuKJD.PDDForms.AdminForms
//
// colProductRemaining
//
dataGridViewCellStyle9.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colProductRemaining.DefaultCellStyle = dataGridViewCellStyle9;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colProductRemaining.DefaultCellStyle = dataGridViewCellStyle4;
this.colProductRemaining.FillWeight = 30F;
this.colProductRemaining.HeaderText = "选品限额";
this.colProductRemaining.Name = "colProductRemaining";
@@ -608,8 +655,8 @@ namespace TemuKJD.PDDForms.AdminForms
//
// colPlus
//
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colPlus.DefaultCellStyle = dataGridViewCellStyle10;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.colPlus.DefaultCellStyle = dataGridViewCellStyle5;
this.colPlus.FillWeight = 15F;
this.colPlus.HeaderText = "+";
this.colPlus.Name = "colPlus";
@@ -709,6 +756,7 @@ namespace TemuKJD.PDDForms.AdminForms
this.colRelogin2.HeaderText = "国际版状态";
this.colRelogin2.Name = "colRelogin2";
this.colRelogin2.ReadOnly = true;
this.colRelogin2.Visible = false;
//
// colMultiLogin
//
@@ -793,60 +841,13 @@ namespace TemuKJD.PDDForms.AdminForms
this.colDelete.ReadOnly = true;
this.colDelete.Visible = false;
//
// chkAutoDrag
//
this.chkAutoDrag.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.chkAutoDrag.AutoSize = true;
this.chkAutoDrag.BackColor = System.Drawing.Color.White;
this.chkAutoDrag.Location = new System.Drawing.Point(597, 0);
this.chkAutoDrag.Name = "chkAutoDrag";
this.chkAutoDrag.Size = new System.Drawing.Size(159, 21);
this.chkAutoDrag.TabIndex = 3;
this.chkAutoDrag.Text = "登录时自动滑动拼图验证";
this.chkAutoDrag.UseVisualStyleBackColor = false;
this.chkAutoDrag.Visible = false;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(911, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(362, 25);
this.ucSplitPage1.TabIndex = 4;
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1273, 25);
this.statusBar.TabIndex = 1;
//
// lblShopId
//
this.lblShopId.AutoSize = true;
this.lblShopId.Location = new System.Drawing.Point(20, 19);
this.lblShopId.Name = "lblShopId";
this.lblShopId.Size = new System.Drawing.Size(50, 17);
this.lblShopId.TabIndex = 455;
this.lblShopId.Text = "ShopId";
this.lblShopId.Visible = false;
//
// AdminShopListForm
// PDDAdminShopListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1273, 610);
this.Controls.Add(this.splitContainer1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Name = "AdminShopListForm";
this.Name = "PDDAdminShopListForm";
this.Text = "AdminShopForm";
this.Load += new System.EventHandler(this.AdminShopForm_Load);
this.VisibleChanged += new System.EventHandler(this.AdminShopForm_VisibleChanged);
@@ -902,6 +903,13 @@ namespace TemuKJD.PDDForms.AdminForms
private System.Windows.Forms.Label label5;
private System.Windows.Forms.CheckBox chkShowDelete;
private UserControls.ButtonEx btnSetSubSa;
private System.Windows.Forms.Panel pnlAddProdRemaining;
private System.Windows.Forms.Label lblAddProdRemaining;
private System.Windows.Forms.NumericUpDown numAddRemaining;
private System.Windows.Forms.Panel panel2;
private DevComponents.DotNetBar.PanelEx btnRemainOK;
private DevComponents.DotNetBar.PanelEx pnlCancel;
private System.Windows.Forms.Label lblShopId;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
@@ -931,12 +939,5 @@ namespace TemuKJD.PDDForms.AdminForms
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
private System.Windows.Forms.Panel pnlAddProdRemaining;
private System.Windows.Forms.Label lblAddProdRemaining;
private System.Windows.Forms.NumericUpDown numAddRemaining;
private System.Windows.Forms.Panel panel2;
private DevComponents.DotNetBar.PanelEx btnRemainOK;
private DevComponents.DotNetBar.PanelEx pnlCancel;
private System.Windows.Forms.Label lblShopId;
}
}
@@ -226,57 +226,58 @@ namespace TemuKJD.PDDForms.AdminForms
PDDAdminShopLoginForm adminLoginForm = new PDDAdminShopLoginForm(shop);
adminLoginForm.openType = EnumOpenType.manage;
adminLoginForm.WindowState = FormWindowState.Maximized;
adminLoginForm.InitUrl = "https://agentseller.temu.com";
adminLoginForm.InitUrl = "https://mms.pinduoduo.com/home/";
adminLoginForm.Show();
}
IsOperate = false;
break;
case "复制Cookie":
string cook = shop.Cookies;
List<CefSharp.Cookie> cooks = null;
try { cooks = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(shop.Cookies); } catch (Exception ex) { }
if (cooks == null)
cooks = new List<CefSharp.Cookie>();
string cookJs = "";
var keys = new string[] { "a42", "_bee", "_f77", "_nano_fp", "api_uid", "rckk", "ru1k", "ru2k", "SUB_PASS_ID" };
//var keys2 = new string[] { "_bee", "_nano_fp", "api_uid", "dilx", "hfsc", "mallid", "njrpl", "seller_temp" };
var keys2 = new string[] { "_bee", "_nano_fp", "api_uid", "dilx", "hfsc", "njrpl", "seller_temp" };
foreach (var shopCook in shop.Cookies.Split(';'))
var keys = new string[] { "_a42", "_bee", "_f77", "_nano_fp", "api_uid", "JSESSIONID", "mms_b84d1838", "rckk", "ru1k", "ru2k", "PASS_ID", "webp", "x-visit-time" };
var keys2 = new string[] { /*"_bee", "_nano_fp", "api_uid", "dilx", "hfsc", "njrpl", "seller_temp"*/ };
foreach (var shopCook in cooks)
{
var cookie = shopCook.Trim();
if (!keys.Any(k=>cookie.StartsWith(k)))
continue;
cookJs += "\r\ndocument.cookie='" + cookie.Substring(0, Math.Max(0, cookie.IndexOf("="))) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';";
}
foreach (var shopCook in shop.Cookies2.Split(';'))
{
var cookie = shopCook.Trim();
cookJs += "\r\ndocument.cookie='" + cookie.Substring(0, Math.Max(0, cookie.IndexOf("="))) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';";
}
foreach (var shopCook in shop.Cookies.Split(';'))
{
var cookie = shopCook.Trim();
var cookie = shopCook.Name + "=" + shopCook.Value;
if (!keys.Any(k => cookie.StartsWith(k)))
continue;
if (!cookie.StartsWith("SUB_PASS_ID") && !cookie.StartsWith("_nano_fp"))
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.kuajingmaihuo.com;';";
cookJs += "\r\ndocument.cookie='" + cookie.Substring(0, Math.Max(0, cookie.IndexOf("="))) + "=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';";
}
foreach (var shopCook in cooks)
{
var cookie = shopCook.Name + "=" + shopCook.Value;
if (!keys.Any(k => cookie.StartsWith(k)))
continue;
if (!cookie.StartsWith("PASS_ID") && !cookie.StartsWith("_nano_fp") && !cookie.StartsWith("JSESSIONID") &&
!cookie.StartsWith("mms_b84d1838") && !cookie.StartsWith("webp") && !cookie.StartsWith("x-visit-time"))
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.pinduoduo.com;expires=" +
DateTime.Now.AddMonths(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
else
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=seller.kuajingmaihuo.com;';";
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=mms.pinduoduo.com; expires=" +
DateTime.Now.AddMonths(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
}
// 全球站cookie
foreach (var shopCook in shop.Cookies2.Split(';'))
{
var cookie = shopCook.Trim();
if (cookie.StartsWith("mallid"))
cookie = "mallid=" + shop.ShopId;
if (!keys2.Any(k => cookie.StartsWith(k)))
continue;
if (!cookie.StartsWith("seller_temp") && !cookie.StartsWith("_nano_fp") && !cookie.StartsWith("mallid"))
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.temu.com; expires=" +
DateTime.Now.AddDays(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
else
cookJs += "\r\ndocument.cookie='" + cookie + "; domain=agentseller.temu.com; expires=" +
DateTime.Now.AddDays(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
}
cookJs += "\r\nwindow.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');";
cookJs += "\r\nwindow.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');";
cookJs += "\r\nsetTimeout(() => { window.location.href='https://agentseller.temu.com'; }, 200)";
//foreach (var shopCook in shop.Cookies2.Split(';'))
//{
// var cookie = shopCook.Trim();
// if (cookie.StartsWith("mallid"))
// cookie = "mallid=" + shop.ShopId;
// if (!keys2.Any(k => cookie.StartsWith(k)))
// continue;
// if (!cookie.StartsWith("seller_temp") && !cookie.StartsWith("_nano_fp") && !cookie.StartsWith("mallid"))
// cookJs += "\r\ndocument.cookie='" + cookie + "; domain=.temu.com; expires=" +
// DateTime.Now.AddDays(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
// else
// cookJs += "\r\ndocument.cookie='" + cookie + "; domain=agentseller.temu.com; expires=" +
// DateTime.Now.AddDays(1).ToUniversalTime().ToString("ddd, dd MMM yyyy HH:mm:ss 'UTC'", new DateTimeFormatInfo()) + "; path=/';";
//}
//cookJs += "\r\nwindow.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');";
//cookJs += "\r\nwindow.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');";
cookJs += "\r\nsetTimeout(() => { window.location.href='https://mms.pinduoduo.com/home'; }, 200)";
Clipboard.SetDataObject(cookJs);
BaseMsgForm.ShowInfo("复制成功");
break;
@@ -410,10 +411,10 @@ namespace TemuKJD.PDDForms.AdminForms
if (BaseClass.SaLevel > 1)
data += "&operate_sub_sa_name=" + BaseClass.UserName;
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
// html = GetHtml.PostUtf8(url, data);
//if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
// html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html)
|| !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass"))
{
@@ -83,7 +83,7 @@
this.splitContainer1.Panel2.Controls.Add(this.btnReload);
this.splitContainer1.Panel2.Controls.Add(this.chkCloseAfterLogin);
this.splitContainer1.Size = new System.Drawing.Size(1438, 736);
this.splitContainer1.SplitterDistance = 674;
this.splitContainer1.SplitterDistance = 675;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -338,7 +338,7 @@
//
// txtAddress
//
this.txtAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.txtAddress.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtAddress.Location = new System.Drawing.Point(3, 3);
this.txtAddress.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
@@ -347,14 +347,14 @@
this.txtAddress.TabIndex = 7;
this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown);
//
// AdminShopLoginForm
// PDDAdminShopLoginForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.ClientSize = new System.Drawing.Size(1440, 800);
this.Controls.Add(this.splitContainer2);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Name = "AdminShopLoginForm";
this.Name = "PDDAdminShopLoginForm";
this.ShowMaximizeBox = true;
this.Text = "店铺登录";
this.TitleText = "店铺登录";
@@ -37,11 +37,10 @@ namespace TemuKJD.PDDForms.AdminForms
public bool isMultiLogin = false;
public string MultiLoginCookieName = "";
public string InitUrl = "";
private string shopCookieHead = "kuajingmaihuo.com";
private string shopCookieHead = "pinduoduo.com";
private string shopCookieHead2 = "temu.com";
private string shopLoginUrl = "http://seller.kuajingmaihuo.com/login";
private string shopMainUrl = "https://seller.kuajingmaihuo.com";
private string shopMainUrl2 = "https://agentseller.temu.com";
private string shopLoginUrl = "https://mms.pinduoduo.com/login";
private string shopMainUrl = "https://mms.pinduoduo.com/home";
private ChromiumWebBrowser cefWebBrowser = null;
private ShopLoginInfo shop = null;
private List<ShopCompany> lstShopCompany = new List<ShopCompany>();
@@ -125,7 +124,8 @@ namespace TemuKJD.PDDForms.AdminForms
string cookies = "";
//List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
List<Cookie> cookieList = CEFBrowser.GetCookieList(shopCookieHead, cefWebBrowser.GetCookieManager(null));
var keys = new string[] { "a42", "_bee", "_f77", "_nano_fp", "api_uid", "rckk", "ru1k", "ru2k", "SUB_PASS_ID" };
List<Cookie> cookieListNew = new List<Cookie>();
var keys = new string[] { "_a42", "_bee", "_f77", "_nano_fp", "api_uid", "JSESSIONID", "mms_b84d1838", "rckk", "ru1k", "ru2k", "PASS_ID", "webp", "x-visit-time" };
if (cookieList != null && cookieList.Count > 0)
{
@@ -134,14 +134,16 @@ namespace TemuKJD.PDDForms.AdminForms
if (!keys.Contains(cookie.Name))
continue;
//SUB_PASS_ID同时出现两个,domain是seller.kuajingmaihuo.com才是能登录店铺后台的
if (cookie.Name == "SUB_PASS_ID" && cookie.Domain != "seller.kuajingmaihuo.com"
&& cookieList.Any(c=>c.Name== "SUB_PASS_ID" && c.Domain == "seller.kuajingmaihuo.com"))
//PASS_ID同时出现两个,domain是mms.pinduoduo.com才是能登录店铺后台的
if (cookie.Name == "PASS_ID" && cookie.Domain != "mms.pinduoduo.com"
&& cookieList.Any(c => c.Name == "PASS_ID" && c.Domain == "mms.pinduoduo.com"))
continue;
cookies += cookie.Name + "=" + cookie.Value + "; ";
cookieListNew.Add(cookie);
}
cookies = cookies.Trim().TrimEnd(';');
//cookies = cookies.Trim().TrimEnd(';');
cookies = JsonHelper.SerializeObject(cookieListNew);
}
if (!string.IsNullOrEmpty(cookies)
@@ -164,6 +166,7 @@ namespace TemuKJD.PDDForms.AdminForms
UserName = shop.UserName,
Notes = shop.Notes,
Cookies = cookies,
AntiContents = new List<string> { sc.AntiContent },
};
if (string.IsNullOrEmpty(shop.Cookies)) // 有cookie的认为是已登录过的
@@ -174,6 +177,15 @@ namespace TemuKJD.PDDForms.AdminForms
if (!html.Contains("\"code\":200"))
isSuccess = false;
}
else
{
var urlAddress = BaseClass.BuildObjString("shop/mdy_anti_content");
var data = UserLogin.GetSignaturex()
+ "&login_name=" + shop.LoginName
+ "&shop_id=" + shop.ShopId
+ "&anti_contents=" + JsonHelper.SerializeObject(shop.AntiContents);
var result = GetHtml.PostUtf8(urlAddress, data);
}
}
shop.Cookies = cookies;
if (isSuccess)
@@ -181,105 +193,7 @@ namespace TemuKJD.PDDForms.AdminForms
shop.LoginStatus = "登录成功";
PDDShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
}
//OnSaveComplete(shop);
//if (this.Created && this.chkCloseAfterLogin.Checked)
//{
// Invoke(new Action(() => { this.Close(); }));
//}
//else
// break;
}
//cefWebBrowser.Load(shopMainUrl2);
var shopStatusRst = PDDShopListForm.GetShopStatus2(shop);
if (!shopStatusRst.Contains("\"success\":true"))
{
//https://agentseller.temu.com/main/authentication?redirectUrl=https%3A%2F%2Fagentseller.temu.com&mallId=634418217169109&asCode=7PaagItuW7ZD1xw2IXNU198596bf60a24327b02d32da6d43f9bcbc40a4b925d0b2ba8c28bd
var codeRst = PDDShopListForm.GetShopLogin2Code(shop);
if (codeRst.Contains("\"success\":true"))
{
string code = BaseRegex.GetStringJson(ref codeRst, "code");
cefWebBrowser.Load("https://agentseller.temu.com/main/authentication" +
"?redirectUrl=https%3A%2F%2Fagentseller.temu.com&mallId=" + shop.ShopId +
"&asCode=" + code);
}
else
{
//cefWebBrowser.Load("https://agentseller.temu.com");
BaseMsgForm.ShowInfo("获取国际版跳转链接失败,请手动跳转并等待Cookie获取结束!");
}
}
else
{
var cookie2 = shop.Cookies2;
//var t = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
var t = CEFBrowser.SetCookieAsync(shopCookieHead2, cookie2, cefWebBrowser.GetCookieManager(null));
t.Wait(5000);
cefWebBrowser.Load("https://agentseller.temu.com");
}
}
if (1 == 1 && this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl2)
{
//https://agentseller.temu.com
if (!cefWebBrowser.GetBrowser().MainFrame.IsValid)
continue;
if (openType != EnumOpenType.login)
continue;
if (!lstShopCompany.Any(c => c.LoginName == shop.LoginName))
continue;
string cookies2 = "";
//List<Cookie> cookieList2 = CEFBrowser.GetCookieList(shopCookieHead2, cefWebBrowser.RequestContext.GetCookieManager(null));
List<Cookie> cookieList2 = CEFBrowser.GetCookieList(shopCookieHead2, cefWebBrowser.GetCookieManager(null)); // cef138
if (cookieList2 != null && cookieList2.Count > 0)
{
for(int i =0; i < cookieList2.Count; i++)
{
var cookie = cookieList2[i];
cookies2 += cookie.Name + "=" + cookie.Value + "; ";
}
cookies2 = cookies2.Trim().TrimEnd(';');
}
if (!string.IsNullOrEmpty(cookies2)
&& lstShopCompany.Any(c => c.LoginName == shop.LoginName))
{
var lstShopCompanyCopy = lstShopCompany.ToList();
lstShopCompanyCopy = lstShopCompanyCopy.Where(l => l.LoginName == shop.LoginName).ToList();
bool isSuccess = true;
foreach (ShopCompany sc in lstShopCompanyCopy)
{
ShopLoginInfo newShop = new ShopLoginInfo()
{
LoginName = shop.LoginName,
Password = shop.Password,
GroupName = shop.GroupName,
ShopAccount = sc.AccountName,
ShopId = sc.AccountId,
SubUserName = shop.SubUserName,
UserName = shop.UserName,
Notes = shop.Notes,
Cookies2 = cookies2,
};
if (string.IsNullOrEmpty(shop.Cookies)) // 有cookie的认为是已登录过的
{
newShop.LoginStatus2 = "国际版在线";
newShop.LastRefreshDate = DateTime.Now.ToString("yyyyMMdd");
var html = ShopBLL.AdminAddServerShop(newShop); // 店铺写入到服务端
if (!html.Contains("\"code\":200"))
isSuccess = false;
}
}
shop.Cookies2 = cookies2;
if (isSuccess)
{
shop.LoginStatus2 = "国际版在线";
PDDShopListForm.UpdateServerShopCookies(shop); // 店铺cookie写入服务端,多店共用一个登录账号一组cookie
}
OnSaveComplete(shop);
if (this.Created && this.chkCloseAfterLogin.Checked)
{
@@ -409,9 +323,19 @@ namespace TemuKJD.PDDForms.AdminForms
if (shop.Cookies2 == null)
shop.Cookies2 = "";
var cookie = shop.Cookies;
if (isMultiLogin)
cookie = shop.DictMultiCookies.Keys.Contains(MultiLoginCookieName) ? shop.DictMultiCookies[MultiLoginCookieName] : "";
//var cookie = shop.Cookies;
//if (isMultiLogin)
// cookie = shop.DictMultiCookies.Keys.Contains(MultiLoginCookieName) ? shop.DictMultiCookies[MultiLoginCookieName] : "";
List<Cookie> cookieLst = new List<Cookie>();
try
{
cookieLst = JsonHelper.DeserializeJsonToList<CefSharp.Cookie>(shop.Cookies);
if (cookieLst == null)
cookieLst = new List<Cookie>();
}
catch
{
}
Task.Run(() =>
{
@@ -424,9 +348,17 @@ namespace TemuKJD.PDDForms.AdminForms
Thread.Sleep(20);
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
//var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.GetCookieManager(null));
t.Wait(5000);
//cef 138 如果没有设置RequestContext 可能为空,直接getCookieManager
//if (this.openType != EnumOpenType.login)
{
//var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.RequestContext.GetCookieManager(null)); // cef138
//var t = CEFBrowser.SetCookieAsync(shopCookieHead, cookie, cefWebBrowser.GetCookieManager(null));
foreach (var cook in cookieLst)
{
var t = CEFBrowser.SetCookieAsync(cook.Domain, cook.Name + "=" + cook.Value + ";", cefWebBrowser.GetCookieManager(null));
t.Wait(5000);
}
}
if (this.openType != EnumOpenType.login)
{
@@ -439,17 +371,22 @@ namespace TemuKJD.PDDForms.AdminForms
//根据登录的具体店铺设置local storage
if (!string.IsNullOrEmpty(shop.ShopId))
{
while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
Thread.Sleep(20);
//while (!cefWebBrowser.IsBrowserInitialized || !cefWebBrowser.GetBrowser().MainFrame.IsValid)
// Thread.Sleep(20);
var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n";
cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
//var storageJsCode = "window.localStorage.setItem('" + "mall-info-id" + "', '" + shop.ShopId + "');\r\n";
//cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
//agentseller-mall-info-id
storageJsCode = "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n";
cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
////agentseller-mall-info-id
//storageJsCode = "window.localStorage.setItem('" + "agentseller-mall-info-id" + "', '" + shop.ShopId + "');\r\n";
//cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(storageJsCode);
}
if (!string.IsNullOrEmpty(InitUrl))
cefWebBrowser.Load(InitUrl);
else
cefWebBrowser.Load(shopMainUrl);
//不是登录的话就此返回
if (openType != EnumOpenType.login)
{
@@ -468,27 +405,17 @@ namespace TemuKJD.PDDForms.AdminForms
}
Thread.Sleep(Randomx.GetId(1500, 2000));
//设置 local storage
//if (GlobalConfig.dicLocalStorage != null)
//{
// Thread.Sleep(500);
// string jsCode = "function setStorage() {";
// foreach (var item in GlobalConfig.dicLocalStorage)
// {
// if (item.Key == "$TCC_CONFIG" || item.Key == "$TCC_CONFIG_operate_config" || item.Key == "menuStyleStr")
// continue;
// jsCode += "window.localStorage.setItem('" + item.Key + "', '" + item.Value + "');\r\n";
// }
// jsCode += "}";
// jsCode += "setStorage();";
// if (cefWebBrowser.GetBrowser().MainFrame.IsValid)
// cefWebBrowser.GetBrowser().MainFrame.ExecuteJavaScriptAsync(jsCode);
//}
if (!this.Created)
return;
while (!cefWebBrowser.Address.StartsWith(shopLoginUrl))
{
Thread.Sleep(1000);
if (!this.Created)
return;
}
CEFBrowser.DeleteCookie(cefWebBrowser.GetCookieManager(null));
InputUserNameAndPassword(cefWebBrowser, shop.LoginName, DataOpenSSL.DecryptString(shop.Password));
});
}
@@ -558,86 +485,81 @@ namespace TemuKJD.PDDForms.AdminForms
cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sb.ToString());
}
int GetAntiContentsTimes = 0;
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++;
shop.AntiContents.Add(antiContent);
while (shop.AntiContents.Count > 10)
shop.AntiContents.RemoveAt(0);
if (!string.IsNullOrEmpty(shop.ShopId) && GetAntiContentsTimes > 5)
{
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);
});
}
}
Task.Run(() =>
{
var data = responseData;
if (data.Contains("supplierId") && data.Contains("\"success\":true"))
{
var supplierIds = BaseRegex.GetMatchRegex(ref data, "\"supplierId\":\\d{5,20}");
if(supplierIds.Count > 0 && supplierIds[0].Groups.Count > 0)
{
var supplierId = supplierIds[0].Groups[0].Value.Replace("\"supplierId\":", "").ParseToLong();
if (supplierId > 0)
this.currentSupplierId = supplierId;
}
}
//var data = responseData;
//if (data.Contains("supplierId") && data.Contains("\"success\":true"))
//{
// var supplierIds = BaseRegex.GetMatchRegex(ref data, "\"supplierId\":\\d{5,20}");
// if(supplierIds.Count > 0 && supplierIds[0].Groups.Count > 0)
// {
// var supplierId = supplierIds[0].Groups[0].Value.Replace("\"supplierId\":", "").ParseToLong();
// if (supplierId > 0)
// this.currentSupplierId = supplierId;
// }
//}
});
if (url.StartsWith("https://seller.kuajingmaihuo.com/settle/site-main"))
{
cefWebBrowser.Load(shopMainUrl);
}
//if (url == shopMainUrl)
if (url == "https://seller.kuajingmaihuo.com/bg/quiet/api/mms/userInfo")
if (url == "https://mms.pinduoduo.com/janus/api/userinfo")
{
Task.Run(() =>
{
var data = responseData;
if (this.shop != null && data.Contains("\"success\":true"))
{
var maskMobile = BaseRegex.GetStringJson(ref data, "maskOwnerMobile");
var maskMobile2 = "||||" + BaseRegex.GetStringJson(ref data, "maskMobile").ParseToString();
if (maskMobile2.Contains("*"))
maskMobile2 = maskMobile2.Substring(maskMobile2.LastIndexOf("*")).Trim('*');
if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName.EndsWith(maskMobile2))
var maskMobile = BaseRegex.GetStringJson(ref data, "mobile");
maskMobile = maskMobile.Split('*').Last();
if (!string.IsNullOrEmpty(maskMobile) && shop.LoginName.EndsWith(maskMobile))
{
lstShopCompany.Clear();
var jObj = JObject.Parse(data);
var jArr = jObj["result"]?["companyList"]?[0]?["malInfoList"] as JArray;
var jArr = jObj["result"] as JArray;
if (jArr == null)
jArr = new JArray();
Thread.Sleep(500);
foreach (var productObj in jArr)
ShopCompany sc = new ShopCompany()
{
var prod = JsonHelper.SerializeObject(productObj);
ShopCompany sc = new ShopCompany()
{
AccountId = BaseRegex.GetStringJson(ref prod, "mallId"),
AccountName = BaseRegex.GetStringJson(ref prod, "mallName"),
LoginName = shop.LoginName,
UserName = BaseClass.UserName,
LoginStatus = "登录成功",
};
this.lstShopCompany.Add(sc);
}
//AccountId = BaseRegex.GetStringJson(ref data, "mallId"),
AccountId = BaseRegex.GetStringJson(ref data, "username"),
AccountName = BaseRegex.GetStringJson(ref data, "mall_name"),
LoginName = shop.LoginName,
UserName = BaseClass.UserName,
LoginStatus = "登录成功",
AntiContent = antiContent,
};
this.lstShopCompany.Add(sc);
}
}
});
}
//if (url.Contains("_signature"))
//{
// var re = request;
// if ((re.Headers != null && re.Headers.AllKeys.Contains("x-secsdk-csrf-token")))
// {
// }
// Task.Run(() =>
// {
// var _url = url;
// var data = responseData;
// var signature = url.Substring(url.IndexOf("_signature=") + "_signature=".Length).Split('&')[0];
// if (shop != null)
// {
// shop.Signature = signature;
// }
// if (url.Contains("x-secsdk-csrf-token") || postData.Contains("x-secsdk-csrf-token") || data.Contains("x-secsdk-csrf-token"))
// {
// }
// });
//}
if (currentUrl.StartsWith("https://seller.kuajingmaihuo.com/goods/product/list") ||
currentUrl.StartsWith("https://agentseller.temu.com/goods/list"))
if (currentUrl.StartsWith("https://mms.pinduoduo.com/goods/goods_list"))
{
Task.Run(() => {
string sAddInputJs = @"
@@ -663,11 +585,13 @@ namespace TemuKJD.PDDForms.AdminForms
addGetProdButton();
function addGetProdButton() {
var productLst = document.getElementsByClassName('product-info_idContent__iDukx');
var productLst = document.getElementsByClassName('goods-id');
for(i=0; i<productLst.length; i++) {
if (productLst[i].innerHTML.indexOf('提取商品') < 0 && productLst[i].innerHTML.indexOf('SPU ID') >= 0) {
var sSpuId = productLst[i].innerText.replace('\r','').replace('\n','').replace('SPU ID:', '');
productLst[i].innerHTML = productLst[i].innerHTML.replace(""></div>"", ""><input type=\""button\"" style=\""margin-left: 50px; width:60px; text-align:center\"" value=\""提取商品\"" onclick=\""shopObj.getProduct('"" + sSpuId + ""'," + this.currentSupplierId + @")\""></div>"");
var addBtnItem = productLst[i].parentElement.parentElement;
if (addBtnItem.parentElement.innerHTML.indexOf('提取商品') < 0 && addBtnItem.parentElement.innerHTML.indexOf('ID:') >= 0) {
var sSpuId = addBtnItem.innerText.replace('\r','').replace('\n','').replace('ID: ', '');
addBtnItem.outerHTML = addBtnItem.outerHTML.replace(""<section>"",""<section style=\""display:inline; float:left; \"">"")
.replace(""</section>"", ""</section><input type=\""button\"" style=\""display:inline; width:60px; margin-left:10px; margin-top:0px; cursor:pointer; border:1px solid\"" value =\""提取商品\"" onclick=\""shopObj.getProduct('"" + sSpuId + ""','" + this.shop.ShopId + @"')\"">"");
}
}
}";
@@ -684,6 +608,13 @@ namespace TemuKJD.PDDForms.AdminForms
/// <param name="_password"></param>
private void InputUserNameAndPassword(ChromiumWebBrowser webBrowser, string _account, string _password)
{
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText);
var jsStr0 = "var clickBox1 = getElementWithText('账号登录'); clickBox1.click()";
var response0 = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr0);
response0.Wait(1000);
Thread.Sleep(Randomx.GetId(500, 1000));
string jsStr1 = "function getInputItem () {var usernameId = document.getElementById('usernameId'); if (usernameId) return 'true';} getInputItem();";
Task<JavascriptResponse> response1 = null;
while (response1?.Result?.Result == null || !response1.Result.Result.ParseToString().Contains("true"))
@@ -700,7 +631,6 @@ namespace TemuKJD.PDDForms.AdminForms
}
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sInputValueChange2);
webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sGetElementWithText);
jsStr1 = "var usernameId = document.getElementById('usernameId'); " +
"changeReactInputValue(usernameId,'" + _account + "');";
@@ -708,7 +638,7 @@ namespace TemuKJD.PDDForms.AdminForms
response1.Wait(1000);
Thread.Sleep(Randomx.GetId(500, 1000));
string jsStr = "var passwordId = document.getElementById('passwordId'); "+
string jsStr = "var passwordId = document.getElementById('passwordId'); " +
"changeReactInputValue(passwordId,'" + _password + "');";
var response = webBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response.Wait(1000);