1添加随机上传商品 2优化pdd api授权逻辑

This commit is contained in:
wule committed 2026-04-02 19:48:38 +08:00
1 parent 07b912e9eb
commit c0b7c2d986
34 files changed
+1651 -603

No files matched your search

+74 -42
View File
@@ -39,6 +39,7 @@
this.btnLoginSelect = new TemuKJD.UserControls.ButtonEx();
this.btnCheck = new TemuKJD.UserControls.ButtonEx();
this.panel4 = new System.Windows.Forms.Panel();
this.btnOpenOrder = new TemuKJD.UserControls.ButtonEx();
this.chkUsePddWorkbanch = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.cmbNotes = new System.Windows.Forms.ComboBox();
this.pnlEmpty = new DevComponents.DotNetBar.PanelEx();
@@ -54,8 +55,6 @@
this.btnRefreshAuth = new TemuKJD.UserControls.ButtonEx();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMallId = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -70,6 +69,7 @@
this.colChatAccount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colBuyApi = new System.Windows.Forms.DataGridViewLinkColumn();
this.colBindApi = new System.Windows.Forms.DataGridViewLinkColumn();
this.colGotoShop = new System.Windows.Forms.DataGridViewLinkColumn();
this.colShopOperate = new System.Windows.Forms.DataGridViewLinkColumn();
this.colRelogin = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -81,6 +81,8 @@
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colEdit = new System.Windows.Forms.DataGridViewLinkColumn();
this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn();
this.chkAutoDrag = new System.Windows.Forms.CheckBox();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -146,9 +148,9 @@
this.panel5.Controls.Add(this.btnRefreshShop);
this.panel5.Controls.Add(this.btnLoginSelect);
this.panel5.Controls.Add(this.btnCheck);
this.panel5.Location = new System.Drawing.Point(1032, 3);
this.panel5.Location = new System.Drawing.Point(1044, 3);
this.panel5.Name = "panel5";
this.panel5.Size = new System.Drawing.Size(229, 40);
this.panel5.Size = new System.Drawing.Size(217, 40);
this.panel5.TabIndex = 1;
//
// btnRefreshShop
@@ -158,7 +160,7 @@
this.btnRefreshShop.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnRefreshShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRefreshShop.ForeColor = System.Drawing.Color.White;
this.btnRefreshShop.Location = new System.Drawing.Point(21, 9);
this.btnRefreshShop.Location = new System.Drawing.Point(7, 9);
this.btnRefreshShop.Margin = new System.Windows.Forms.Padding(2);
this.btnRefreshShop.Name = "btnRefreshShop";
this.btnRefreshShop.Size = new System.Drawing.Size(66, 26);
@@ -174,7 +176,7 @@
this.btnLoginSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnLoginSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnLoginSelect.ForeColor = System.Drawing.Color.White;
this.btnLoginSelect.Location = new System.Drawing.Point(162, 9);
this.btnLoginSelect.Location = new System.Drawing.Point(148, 9);
this.btnLoginSelect.Margin = new System.Windows.Forms.Padding(2);
this.btnLoginSelect.Name = "btnLoginSelect";
this.btnLoginSelect.Size = new System.Drawing.Size(66, 26);
@@ -190,7 +192,7 @@
this.btnCheck.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCheck.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCheck.ForeColor = System.Drawing.Color.White;
this.btnCheck.Location = new System.Drawing.Point(92, 9);
this.btnCheck.Location = new System.Drawing.Point(78, 9);
this.btnCheck.Margin = new System.Windows.Forms.Padding(2);
this.btnCheck.Name = "btnCheck";
this.btnCheck.Size = new System.Drawing.Size(66, 26);
@@ -201,6 +203,7 @@
//
// panel4
//
this.panel4.Controls.Add(this.btnOpenOrder);
this.panel4.Controls.Add(this.chkUsePddWorkbanch);
this.panel4.Controls.Add(this.cmbNotes);
this.panel4.Controls.Add(this.pnlEmpty);
@@ -215,13 +218,30 @@
this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel4.Location = new System.Drawing.Point(3, 3);
this.panel4.Name = "panel4";
this.panel4.Size = new System.Drawing.Size(1023, 40);
this.panel4.Size = new System.Drawing.Size(1035, 40);
this.panel4.TabIndex = 0;
//
// btnOpenOrder
//
this.btnOpenOrder.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnOpenOrder.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnOpenOrder.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnOpenOrder.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOpenOrder.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOpenOrder.ForeColor = System.Drawing.Color.White;
this.btnOpenOrder.Location = new System.Drawing.Point(933, 9);
this.btnOpenOrder.Margin = new System.Windows.Forms.Padding(2);
this.btnOpenOrder.Name = "btnOpenOrder";
this.btnOpenOrder.Size = new System.Drawing.Size(100, 25);
this.btnOpenOrder.TabIndex = 466;
this.btnOpenOrder.Text = "登录订单系统";
this.btnOpenOrder.UseVisualStyleBackColor = false;
this.btnOpenOrder.Click += new System.EventHandler(this.btnOpenOrder_Click);
//
// chkUsePddWorkbanch
//
this.chkUsePddWorkbanch.AutoSize = true;
this.chkUsePddWorkbanch.Location = new System.Drawing.Point(897, 11);
this.chkUsePddWorkbanch.Location = new System.Drawing.Point(800, 11);
this.chkUsePddWorkbanch.Name = "chkUsePddWorkbanch";
this.chkUsePddWorkbanch.Size = new System.Drawing.Size(128, 21);
this.chkUsePddWorkbanch.TabIndex = 417;
@@ -233,7 +253,7 @@
// cmbNotes
//
this.cmbNotes.FormattingEnabled = true;
this.cmbNotes.Location = new System.Drawing.Point(584, 10);
this.cmbNotes.Location = new System.Drawing.Point(522, 10);
this.cmbNotes.Name = "cmbNotes";
this.cmbNotes.Size = new System.Drawing.Size(120, 25);
this.cmbNotes.TabIndex = 413;
@@ -244,7 +264,7 @@
this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control;
this.pnlEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlEmpty.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlEmpty.Location = new System.Drawing.Point(786, 9);
this.pnlEmpty.Location = new System.Drawing.Point(718, 9);
this.pnlEmpty.Name = "pnlEmpty";
this.pnlEmpty.Size = new System.Drawing.Size(66, 26);
this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -270,7 +290,7 @@
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSearch.ForeColor = System.Drawing.Color.White;
this.btnSearch.Location = new System.Drawing.Point(715, 9);
this.btnSearch.Location = new System.Drawing.Point(647, 9);
this.btnSearch.Margin = new System.Windows.Forms.Padding(2);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(66, 26);
@@ -282,7 +302,7 @@
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(525, 14);
this.label4.Location = new System.Drawing.Point(462, 14);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(68, 17);
this.label4.TabIndex = 377;
@@ -290,7 +310,7 @@
//
// txtShopName
//
this.txtShopName.Location = new System.Drawing.Point(402, 11);
this.txtShopName.Location = new System.Drawing.Point(352, 11);
this.txtShopName.Name = "txtShopName";
this.txtShopName.Size = new System.Drawing.Size(110, 23);
this.txtShopName.TabIndex = 374;
@@ -298,7 +318,7 @@
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(354, 14);
this.label3.Location = new System.Drawing.Point(304, 14);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 17);
this.label3.TabIndex = 375;
@@ -306,7 +326,7 @@
//
// txtShopId
//
this.txtShopId.Location = new System.Drawing.Point(232, 11);
this.txtShopId.Location = new System.Drawing.Point(194, 11);
this.txtShopId.Name = "txtShopId";
this.txtShopId.Size = new System.Drawing.Size(110, 23);
this.txtShopId.TabIndex = 372;
@@ -314,7 +334,7 @@
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(184, 14);
this.label2.Location = new System.Drawing.Point(146, 14);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(55, 17);
this.label2.TabIndex = 373;
@@ -438,6 +458,7 @@
this.colChatAccount,
this.colLoginStatus,
this.colBuyApi,
this.colBindApi,
this.colGotoShop,
this.colShopOperate,
this.colRelogin,
@@ -459,31 +480,6 @@
this.dgvShop.TabIndex = 5;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
// 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(1108, 2);
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;
this.chkAutoDrag.Click += new System.EventHandler(this.chkAutoDrag_Click);
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Bottom;
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, -1);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1264, 29);
this.statusBar.TabIndex = 1;
//
// colSelect
//
this.colSelect.FillWeight = 26F;
@@ -586,6 +582,15 @@
this.colBuyApi.Name = "colBuyApi";
this.colBuyApi.ReadOnly = true;
//
// colBindApi
//
this.colBindApi.FillWeight = 46F;
this.colBindApi.HeaderText = "绑定授权";
this.colBindApi.Name = "colBindApi";
this.colBindApi.ReadOnly = true;
this.colBindApi.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colBindApi.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colGotoShop
//
this.colGotoShop.FillWeight = 46F;
@@ -686,6 +691,31 @@
this.colDelete.Name = "colDelete";
this.colDelete.ReadOnly = true;
//
// 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(1108, 2);
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;
this.chkAutoDrag.Click += new System.EventHandler(this.chkAutoDrag_Click);
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Bottom;
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, -1);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1264, 29);
this.statusBar.TabIndex = 1;
//
// PDDShopListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -761,6 +791,7 @@
private System.Windows.Forms.DataGridViewTextBoxColumn colChatAccount;
private System.Windows.Forms.DataGridViewTextBoxColumn colLoginStatus;
private System.Windows.Forms.DataGridViewLinkColumn colBuyApi;
private System.Windows.Forms.DataGridViewLinkColumn colBindApi;
private System.Windows.Forms.DataGridViewLinkColumn colGotoShop;
private System.Windows.Forms.DataGridViewLinkColumn colShopOperate;
private System.Windows.Forms.DataGridViewLinkColumn colRelogin;
@@ -772,5 +803,6 @@
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewLinkColumn colEdit;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
public UserControls.ButtonEx btnOpenOrder;
}
}
+35 -3
View File
@@ -22,6 +22,7 @@ using NaiBa.Util;
using System.Globalization;
using TemuKJD.BLL;
using System.Diagnostics;
using TemuKJD.BLL.PddApi;
//using TemuKJD.PDDForms.AdminForms;
namespace TemuKJD.PDDForms.ShopForms
@@ -58,8 +59,11 @@ namespace TemuKJD.PDDForms.ShopForms
localShop.DbId = serverShop.DbId;
localShop.UserName = serverShop.UserName;
localShop.SubUserName = serverShop.SubUserName;
localShop.ApiAuthInfoList = new List<AuthInfo>();
localShop.ApiAuthInfoList.AddRange(serverShop.ApiAuthInfoList);
if (serverShop.ApiAuthInfoList != null && serverShop.ApiAuthInfoList.Count > 0)
{
localShop.ApiAuthInfoList = new List<AuthInfo>();
localShop.ApiAuthInfoList.AddRange(serverShop.ApiAuthInfoList);
}
localShop.BuyApiAuth.AccessToken = serverShop.BuyApiAuth.AccessToken;
localShop.BuyApiAuth.AddTime = serverShop.BuyApiAuth.AddTime;
localShop.BuyApiAuth.AppKey = serverShop.BuyApiAuth.AppKey;
@@ -78,6 +82,7 @@ namespace TemuKJD.PDDForms.ShopForms
GlobalConfig.ShopLoginList.Add(localShop);
}
}
PddApiHelper.PddGetLocalTokens();
}
public static List<ShopLoginInfo> GetServerShop()
@@ -483,6 +488,7 @@ namespace TemuKJD.PDDForms.ShopForms
param.ChatAccount,
"",
"购买授权",
"绑定授权",
"进入",
"检测",
string.IsNullOrWhiteSpace(param.LoginStatus) ? "未登录" : param.LoginStatus.Trim(),
@@ -857,7 +863,18 @@ namespace TemuKJD.PDDForms.ShopForms
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/service-detail?detailId=84862";
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
}
break;
case "绑定授权":
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId + "&redirect_uri=" +
GetHtml.UrlEncodeUtf8("http://po.e57.cn/login") + "?source=pdd_code&response_type=code";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;
shopLoginForm.ShowDialog();
btnRefreshCookie_Click(null, null);
@@ -1163,5 +1180,20 @@ function setCookie(name, value, daysToLive, path, domain, secure, httpOnly, same
BaseMsgForm.ShowInfo("您已切换Cookie来源,请重启软件生效!");
NaiBa.Util.Helper.ConfigHelper.SaveConfig("use_pdd_workbanch", chkUsePddWorkbanch.Checked);
}
private void btnOpenOrder_Click(object sender, EventArgs e)
{
ShopLoginInfo shop = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ShopLoginInfo>("pdd_dian_tong_ling_login_info");
if (shop == null)
shop = new ShopLoginInfo();
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.WindowState = FormWindowState.Maximized;
shopLoginForm.txtUserName.ReadOnly = false;
shopLoginForm.txtPassWord.ReadOnly = false;
shopLoginForm.btnSaveUserInfo.Visible = true;
shopLoginForm.InitUrl = "https://po.e57.cn/login?redirect=%2Findex";
shopLoginForm.Show();
}
}
}
@@ -159,6 +159,9 @@
<metadata name="colBuyApi.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBindApi.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colGotoShop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
+84 -56
View File
@@ -36,6 +36,10 @@
this.btnMultiLogin = new DevComponents.DotNetBar.PanelEx();
this.btnDel = new DevComponents.DotNetBar.PanelEx();
this.pnlUploadOpBtns = new System.Windows.Forms.Panel();
this.pictureBox9 = new System.Windows.Forms.PictureBox();
this.label6 = new System.Windows.Forms.Label();
this.txtSendPrice = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtSendCount = new System.Windows.Forms.TextBox();
this.btnSendToUpload = new DevComponents.DotNetBar.PanelEx();
this.numMinPrice = new System.Windows.Forms.NumericUpDown();
@@ -64,16 +68,14 @@
this.chkCloseAfterLogin = new DevComponents.DotNetBar.Controls.CheckBoxX();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.txtAddress = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.txtSendPrice = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
this.pictureBox9 = new System.Windows.Forms.PictureBox();
this.btnSaveUserInfo = new DevComponents.DotNetBar.PanelEx();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.pnlMultiLogin.SuspendLayout();
this.pnlUploadOpBtns.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numMinPrice)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).BeginInit();
@@ -87,7 +89,6 @@
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).BeginInit();
this.SuspendLayout();
//
// splitContainer1
@@ -108,6 +109,7 @@
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.btnSaveUserInfo);
this.splitContainer1.Panel2.Controls.Add(this.pnlUploadOpBtns);
this.splitContainer1.Panel2.Controls.Add(this.btnLoginAgain);
this.splitContainer1.Panel2.Controls.Add(this.label2);
@@ -120,7 +122,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 = 668;
this.splitContainer1.SplitterDistance = 669;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -244,6 +246,47 @@
this.pnlUploadOpBtns.Size = new System.Drawing.Size(812, 53);
this.pnlUploadOpBtns.TabIndex = 463;
//
// pictureBox9
//
this.pictureBox9.Location = new System.Drawing.Point(586, 27);
this.pictureBox9.Name = "pictureBox9";
this.pictureBox9.Size = new System.Drawing.Size(24, 24);
this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox9.TabIndex = 494;
this.pictureBox9.TabStop = false;
this.pictureBox9.Tag = "11";
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(699, 6);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(20, 17);
this.label6.TabIndex = 493;
this.label6.Text = "元";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtSendPrice
//
this.txtSendPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.txtSendPrice.Location = new System.Drawing.Point(668, 3);
this.txtSendPrice.Name = "txtSendPrice";
this.txtSendPrice.Size = new System.Drawing.Size(31, 23);
this.txtSendPrice.TabIndex = 492;
this.txtSendPrice.Text = "20";
//
// label5
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(613, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 17);
this.label5.TabIndex = 491;
this.label5.Text = "提交价格";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtSendCount
//
this.txtSendCount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -518,7 +561,7 @@
this.btnCopyPassword.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyPassword.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopyPassword.ForeColor = System.Drawing.Color.White;
this.btnCopyPassword.Location = new System.Drawing.Point(276, 31);
this.btnCopyPassword.Location = new System.Drawing.Point(191, 31);
this.btnCopyPassword.Margin = new System.Windows.Forms.Padding(2);
this.btnCopyPassword.Name = "btnCopyPassword";
this.btnCopyPassword.Size = new System.Drawing.Size(57, 25);
@@ -534,7 +577,7 @@
this.btnCopyUserName.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnCopyUserName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnCopyUserName.ForeColor = System.Drawing.Color.White;
this.btnCopyUserName.Location = new System.Drawing.Point(276, 4);
this.btnCopyUserName.Location = new System.Drawing.Point(191, 4);
this.btnCopyUserName.Margin = new System.Windows.Forms.Padding(2);
this.btnCopyUserName.Name = "btnCopyUserName";
this.btnCopyUserName.Size = new System.Drawing.Size(57, 25);
@@ -550,7 +593,7 @@
this.txtPassWord.Name = "txtPassWord";
this.txtPassWord.PasswordChar = '●';
this.txtPassWord.ReadOnly = true;
this.txtPassWord.Size = new System.Drawing.Size(221, 23);
this.txtPassWord.Size = new System.Drawing.Size(135, 23);
this.txtPassWord.TabIndex = 374;
//
// txtUserName
@@ -559,7 +602,7 @@
this.txtUserName.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
this.txtUserName.Name = "txtUserName";
this.txtUserName.ReadOnly = true;
this.txtUserName.Size = new System.Drawing.Size(221, 23);
this.txtUserName.Size = new System.Drawing.Size(135, 23);
this.txtUserName.TabIndex = 373;
//
// btnStop
@@ -644,46 +687,30 @@
this.txtAddress.TabIndex = 7;
this.txtAddress.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtAddress_KeyDown);
//
// label5
// btnSaveUserInfo
//
this.label5.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(613, 6);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(56, 17);
this.label5.TabIndex = 491;
this.label5.Text = "提交价格";
this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// txtSendPrice
//
this.txtSendPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.txtSendPrice.Location = new System.Drawing.Point(668, 3);
this.txtSendPrice.Name = "txtSendPrice";
this.txtSendPrice.Size = new System.Drawing.Size(31, 23);
this.txtSendPrice.TabIndex = 492;
this.txtSendPrice.Text = "20";
//
// label6
//
this.label6.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(699, 6);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(20, 17);
this.label6.TabIndex = 493;
this.label6.Text = "元";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// pictureBox9
//
this.pictureBox9.Location = new System.Drawing.Point(586, 27);
this.pictureBox9.Name = "pictureBox9";
this.pictureBox9.Size = new System.Drawing.Size(24, 24);
this.pictureBox9.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox9.TabIndex = 494;
this.pictureBox9.TabStop = false;
this.pictureBox9.Tag = "11";
this.btnSaveUserInfo.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSaveUserInfo.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSaveUserInfo.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveUserInfo.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveUserInfo.Location = new System.Drawing.Point(251, 4);
this.btnSaveUserInfo.Name = "btnSaveUserInfo";
this.btnSaveUserInfo.Size = new System.Drawing.Size(88, 25);
this.btnSaveUserInfo.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveUserInfo.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveUserInfo.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveUserInfo.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnSaveUserInfo.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnSaveUserInfo.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnSaveUserInfo.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnSaveUserInfo.Style.GradientAngle = 90;
this.btnSaveUserInfo.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveUserInfo.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSaveUserInfo.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSaveUserInfo.TabIndex = 470;
this.btnSaveUserInfo.Text = "保存登录信息";
this.btnSaveUserInfo.Visible = false;
this.btnSaveUserInfo.Click += new System.EventHandler(this.btnSaveUserInfo_Click);
//
// PDDShopLoginForm
//
@@ -707,6 +734,7 @@
this.pnlMultiLogin.ResumeLayout(false);
this.pnlUploadOpBtns.ResumeLayout(false);
this.pnlUploadOpBtns.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numMinPrice)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox8)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox7)).EndInit();
@@ -721,7 +749,6 @@
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox9)).EndInit();
this.ResumeLayout(false);
}
@@ -731,12 +758,6 @@
private System.Windows.Forms.SplitContainer splitContainer1;
private UserControls.ButtonEx btnStop;
private UserControls.ButtonEx btnReload;
private System.Windows.Forms.TextBox txtPassWord;
private System.Windows.Forms.TextBox txtUserName;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private UserControls.ButtonEx btnCopyPassword;
private UserControls.ButtonEx btnCopyUserName;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.TextBox txtAddress;
private UserControls.ButtonEx btnLoginAgain;
@@ -767,5 +788,12 @@
private System.Windows.Forms.TextBox txtSendPrice;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.PictureBox pictureBox9;
public System.Windows.Forms.TextBox txtPassWord;
public System.Windows.Forms.TextBox txtUserName;
public System.Windows.Forms.Label label2;
public System.Windows.Forms.Label label1;
public UserControls.ButtonEx btnCopyPassword;
public UserControls.ButtonEx btnCopyUserName;
public DevComponents.DotNetBar.PanelEx btnSaveUserInfo;
}
}
@@ -505,11 +505,40 @@ namespace TemuKJD.PDDForms.ShopForms
private void CefWebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e)
{
if (this.Created && !this.Disposing && !this.IsDisposed)
{
Invoke(new Action(() =>
{
currentUrl = e.Address;
txtAddress.Text = e.Address;
}));
}
if (e.Address == "https://po.e57.cn/login?redirect=%2Findex" && shop != null && !string.IsNullOrEmpty(shop.LoginName))
{
Task.Run(() =>
{
Thread.Sleep(2000);
// var jsStr = @"var txt1 = document.getElementByClassName('el-input__inner')[0]; txt1.focus(); txt1.click(); keyboardInput(txt1, '" + _account + "');"
var _account = shop.LoginName;
var _password = DataOpenSSL.DecryptString(shop.Password);
cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sInputValueChange2);
var jsStr1 = "var usernameId = document.getElementsByClassName('el-input__inner')[0]; " +
"changeReactInputValue(usernameId,'" + _account + "');";
var response1 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr1);
response1.Wait(1000);
Thread.Sleep(Randomx.GetId(50, 100));
if (!string.IsNullOrEmpty(_password))
{
string jsStr = "var passwordId = document.getElementsByClassName('el-input__inner')[1]; " +
"changeReactInputValue(passwordId,'" + _password + "');";
var response = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response.Wait(1000);
Thread.Sleep(Randomx.GetId(500, 1000));
}
});
}
}
private void CefWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e)
@@ -690,9 +719,40 @@ namespace TemuKJD.PDDForms.ShopForms
this.lstShopCompany.Add(sc);
}
}
if (openType == EnumOpenType.manage && string.IsNullOrWhiteSpace(shop.MallId))
{
shop.MallId = BaseRegex.GetStringJson(ref data, "mall_id");
shop.ShopId = BaseRegex.GetStringJson(ref data, "username");
shop.ShopAccount = BaseRegex.GetStringJson(ref data, "mall_name");
var mdyShopUrl = BaseClass.BuildObjString("shop/mdy_shop");
var mdyShopData = UserLogin.GetSignaturex()
+ "&login_name=" + shop.LoginName
+ "&new_shop_id=" + shop.ShopId
+ "&shop_account=" + shop.ShopAccount
+ "&mall_id=" + shop.MallId;
var result = GetHtml.PostUtf8(mdyShopUrl, mdyShopData);
}
}
});
}
// 有些店铺mall_id未获取,补救(260401,临时,后面等店铺重新登录后就可以移除)
if (url.Contains("https://mms.pinduoduo.com/janus/api/new/userinfo") && responseData.Contains("mall_id"))
{
if (openType == EnumOpenType.manage && string.IsNullOrWhiteSpace(shop.MallId))
{
var data = responseData;
shop.MallId = BaseRegex.GetStringJson(ref data, "mall_id");
shop.ShopId = BaseRegex.GetStringJson(ref data, "username");
var mdyShopUrl = BaseClass.BuildObjString("shop/mdy_shop");
var mdyShopData = UserLogin.GetSignaturex()
+ "&login_name=" + shop.LoginName
+ "&new_shop_id=" + shop.ShopId
+ "&shop_account=" + shop.ShopAccount
+ "&mall_id=" + shop.MallId;
var result = GetHtml.PostUtf8(mdyShopUrl, mdyShopData);
}
}
//if (responseData.Contains("球球小小店铺55") && responseData.Contains("pdd24873711027"))
//{
@@ -1671,5 +1731,41 @@ function getElementWithText(sText)
BaseMsgForm.ShowError(ex.Message);
}
}
private void btnSaveUserInfo_Click(object sender, EventArgs e)
{
if (shop == null)
return;
shop.LoginName = this.txtUserName.Text;
shop.Password = DataOpenSSL.EncryptString(this.txtPassWord.Text);
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_dian_tong_ling_login_info", shop);
Task.Run(() =>
{
Thread.Sleep(100);
// var jsStr = @"var txt1 = document.getElementByClassName('el-input__inner')[0]; txt1.focus(); txt1.click(); keyboardInput(txt1, '" + _account + "');"
var _account = shop.LoginName;
var _password = DataOpenSSL.DecryptString(shop.Password);
cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(sInputValueChange2);
var jsStr1 = "var usernameId = document.getElementsByClassName('el-input__inner')[0]; " +
"changeReactInputValue(usernameId,'" + _account + "');";
var response1 = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr1);
response1.Wait(1000);
Thread.Sleep(Randomx.GetId(50, 100));
if (!string.IsNullOrEmpty(_password))
{
string jsStr = "var passwordId = document.getElementsByClassName('el-input__inner')[1]; " +
"changeReactInputValue(passwordId,'" + _password + "');";
var response = cefWebBrowser.GetBrowser().MainFrame.EvaluateScriptAsync(jsStr);
response.Wait(1000);
Thread.Sleep(Randomx.GetId(500, 1000));
}
});
}
}
}