修改程序逻辑,准备批量打包

This commit is contained in:
wule committed 2026-05-28 17:28:08 +08:00
1 parent aab73b978f
commit 55528e5109
30 files changed
+297 -150

No files matched your search

+1
View File
@@ -9,3 +9,4 @@ packages
bin bin
*.rar *.rar
*.zip *.zip
/Update/Update/*.user
+11 -7
View File
@@ -27,7 +27,9 @@ namespace AllBase
/// <summary> /// <summary>
/// 版本ID /// 版本ID
/// </summary> /// </summary>
public static int VersionCount = 1113; public static int VersionCount = 1115;
public static string MainPath = "29wx";
//public static string MainPath = "kuajingda";
//public static int VersionCount = 613; //public static int VersionCount = 613;
/// <summary> /// <summary>
@@ -41,7 +43,6 @@ namespace AllBase
public static Image LoginImage = null; public static Image LoginImage = null;
public static Image LogoImage = null; public static Image LogoImage = null;
public static Icon Ico = null; public static Icon Ico = null;
public static string MainPath = "kuajingda";
public static bool UsePddWorkbanch = true; public static bool UsePddWorkbanch = true;
public static bool NoRegedit = false; public static bool NoRegedit = false;
public static bool IsPinduoduo = false; public static bool IsPinduoduo = false;
@@ -721,6 +722,11 @@ namespace AllBase
string c = ((int)y).ToString(); string c = ((int)y).ToString();
return GetMd5(c); //返回签名的MD5结果 return GetMd5(c); //返回签名的MD5结果
} }
public static string BuildDefaultObjString(string file, bool IsLoginDef = false)
{
return LoginApiUrl + "/" + file + "?obj=" + "/" + file;
}
/// <summary> /// <summary>
/// 生成OBJ路径 /// 生成OBJ路径
/// </summary> /// </summary>
@@ -735,23 +741,21 @@ namespace AllBase
//return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file; //return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file;
//http://localhost:8000/user/user_login //http://localhost:8000/user/user_login
//pdd相关操作 if (BaseClass.MainPath == "29pdd")
if (BaseClass.MainPath == "binxixi")
{ {
return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file; return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file;
} }
if (BaseClass.MainPath == "douyin") if (BaseClass.MainPath == "29dy")
{ {
return LoginApiUrl + "/dyxd_" + file + "?obj=" + BaseClass.MainPath + "/dyxd_" + file; return LoginApiUrl + "/dyxd_" + file + "?obj=" + BaseClass.MainPath + "/dyxd_" + file;
} }
if (BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29wx")
{ {
return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file; return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file;
} }
return LoginApiUrl + "/" + file+ "?obj=" + BaseClass.MainPath + "/" + file; return LoginApiUrl + "/" + file+ "?obj=" + BaseClass.MainPath + "/" + file;
} }
public static string BuildPDDObjString(string file, bool IsLoginDef = false) public static string BuildPDDObjString(string file, bool IsLoginDef = false)
{ {
return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file; return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file;
@@ -29,6 +29,9 @@ namespace KJD_Web.BLL
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString; var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString; var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString;
serverVersion = "1115";
UpdateFiles = "http://weidian.e57.cn/kjd_update/Update1115.zip";
if (version > LowVersion.ParseToInt()) if (version > LowVersion.ParseToInt())
{ {
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk + return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
@@ -45,5 +48,42 @@ namespace KJD_Web.BLL
} }
return "{\"code\":19999,\"msg\":\"未知错误\"}"; return "{\"code\":19999,\"msg\":\"未知错误\"}";
} }
public string GetUpdateNew(string inputData)
{
//string time1 = Encryption(time);
//return "time=" + time + "&code=" + time1 + "&NbCodeVersion=1" + "&version=" + BaseClass.VersionCount
if (!string.IsNullOrEmpty(inputData))
{
var time = 0;
int.TryParse(RegexUtils.GetStringQuery(ref inputData, "time"), out time);
string time1 = RegexUtils.GetStringQuery(ref inputData, "code");
if (time1 != EncrypUtil.Encryption(time))
return "{\"code\":50000,\"msg\":\"校验失败\"}";
var version = RegexUtils.GetStringQuery(ref inputData, "version").ParseToInt();
var serverVersion = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateVersion"].ConnectionString;
var UpdateNewUrl = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateNewUrl"].ConnectionString;
var UpdateExe = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExe"].ConnectionString;
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString;
if (version > LowVersion.ParseToInt())
{
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
"\",\"exe_address\":\"" + UpdateExe + "\",\"file_address\":\"" + UpdateNewUrl + "\"}";
}
else if (version > 0)
{
return "{\"code\":501,\"msg\":\"版本过低已无法直接升级,请联系管理员获取最新安装包\"}";
}
else
{
return "{\"code\":502,\"msg\":\"get update version failed\"}";
}
}
return "{\"code\":19999,\"msg\":\"未知错误\"}";
}
} }
} }
@@ -54,7 +54,7 @@ namespace KJD_Web
} }
} }
[WebMethod] [WebMethod]
public void get_update() public void get_update()
{ {
@@ -66,5 +66,17 @@ namespace KJD_Web
Context.Response.Write(result); Context.Response.Write(result);
Context.Response.End(); Context.Response.End();
} }
[WebMethod]
public void get_update_new()
{
var jsontext = GetRequestJsonString();
var result = jsontext;
result = new UpadteManage().GetUpdateNew(jsontext);
Context.Response.Write(result);
Context.Response.End();
}
} }
} }
+2 -2
View File
@@ -11,8 +11,8 @@
<add name="LowVersion" connectionString="523"/> <add name="LowVersion" connectionString="523"/>
<add name="LimitVersion" connectionString="823"/> <add name="LimitVersion" connectionString="823"/>
<add name="UpdateExe" connectionString="http://1.13.195.131:9000/Download/Update.exe"/> <add name="UpdateExe" connectionString="http://1.13.195.131:9000/Download/Update.exe"/>
<add name="UpdateFiles" connectionString="http://1.13.195.131:9000/Download/Update525.zip"/> <add name="UpdateNewUrl" connectionString="http://weidian.e57.cn/kjd_update/"/>
<add name="UpdateExeChk" connectionString="324527ACE5020DCA77D65A5037718B65"/> <add name="UpdateExeChk" connectionString="CE4A009B7AA330314F03EEA0C3AB23F9"/>
<add name="GetReturnPackage" connectionString="true"/> <add name="GetReturnPackage" connectionString="true"/>
<add name="GetWXRecommendHotProd" connectionString="true"/> <add name="GetWXRecommendHotProd" connectionString="true"/>
<add name="GetWXRecommendHotProdOncePerDay" connectionString="false"/> <add name="GetWXRecommendHotProdOncePerDay" connectionString="false"/>
+8 -2
View File
@@ -23,10 +23,16 @@ namespace Publish
{ {
try try
{ {
int fileId = 0; var dir = "..\\AllBase\\BaseClass.cs";
string baseClassStr = File.ReadAllText(dir);
var mainPath = baseClassStr.Substring(baseClassStr.IndexOf("MainPath = \"") + "MainPath = \"".Length);
mainPath = mainPath.Split('\"')[0];
var versionCount = baseClassStr.Substring(baseClassStr.IndexOf("VersionCount = ") + "VersionCount = ".Length);
versionCount = versionCount.Split(';')[0];
int version = Convert.ToInt32(versionCount);
List<string> filePathLst = new List<string>(); List<string> filePathLst = new List<string>();
string destinationZip = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Update" + fileId + ".zip"; string destinationZip = AppDomain.CurrentDomain.SetupInformation.ApplicationBase + "Update" + mainPath + version + ".zip";
foreach (var item in this.lstFile.Items) foreach (var item in this.lstFile.Items)
{ {
filePathLst.Add(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + item.ToString()); filePathLst.Add(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + item.ToString());
+42 -3
View File
@@ -866,7 +866,12 @@ namespace TemuKJD.BLL
} }
} }
/// <summary>
/// 微信店铺采集转拼多多
/// </summary>
/// <param name="convertRst"></param>
/// <param name="dbProd"></param>
/// <returns></returns>
public PDDProductInfo WXProdToPddConvert(out string convertRst, KJDDBProduct dbProd) public PDDProductInfo WXProdToPddConvert(out string convertRst, KJDDBProduct dbProd)
{ {
convertRst = ""; convertRst = "";
@@ -1220,7 +1225,12 @@ namespace TemuKJD.BLL
} }
} }
/// <summary>
/// 1688网页端采集转拼多多
/// </summary>
/// <param name="convertRst"></param>
/// <param name="dbProd"></param>
/// <returns></returns>
public PDDProductInfo _1688ClientToPddConvert(out string convertRst, KJDDBProduct dbProd) public PDDProductInfo _1688ClientToPddConvert(out string convertRst, KJDDBProduct dbProd)
{ {
convertRst = ""; convertRst = "";
@@ -1565,7 +1575,7 @@ namespace TemuKJD.BLL
} }
/// <summary> /// <summary>
/// 1688外部数据转拼多多 /// 1688外部数据转拼多多(万象工具)
/// </summary> /// </summary>
/// <param name="convertRst"></param> /// <param name="convertRst"></param>
/// <param name="dbProd"></param> /// <param name="dbProd"></param>
@@ -1770,6 +1780,17 @@ namespace TemuKJD.BLL
prodInfo.detail.size_spec_id = null; prodInfo.detail.size_spec_id = null;
prodInfo.detail.sku = new List<sku_item>(); prodInfo.detail.sku = new List<sku_item>();
if (_1688OutProdInfo.skus == null)
_1688OutProdInfo.skus = new List<_1688Sku>();
if (_1688OutProdInfo.skus.Count == 0)
{
_1688OutProdInfo.skus.Add(new _1688Sku()
{
skuId = -1,
quantity = 999,
price = (_1688OutProdInfo.priceHigh.ParseToDecimal() * 100).ParseToInt(),
});
}
foreach (var sku in _1688OutProdInfo.skus) foreach (var sku in _1688OutProdInfo.skus)
{ {
var postFeeValue = (_1688OutProdInfo.deliveryInfo?.carriageList?.Max(c => c.price)).ParseToDecimal(); var postFeeValue = (_1688OutProdInfo.deliveryInfo?.carriageList?.Max(c => c.price)).ParseToDecimal();
@@ -1849,6 +1870,18 @@ namespace TemuKJD.BLL
} }
} }
} }
if (skuInfo.spec.Count == 0)
skuInfo.spec.Add(new spec_item()
{
parent_id = 0,
parent_name = "款式",
spec_id = 0,
spec_name = "默认",
});
if(string.IsNullOrEmpty(skuInfo.thumb_url))
{
skuInfo.thumb_url = prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1)?.url;
}
prodInfo.detail.sku.Add(skuInfo); prodInfo.detail.sku.Add(skuInfo);
} }
prodInfo.detail.sku_type = null; prodInfo.detail.sku_type = null;
@@ -1920,6 +1953,12 @@ namespace TemuKJD.BLL
} }
} }
/// <summary>
/// 微信商城手机版转拼多多
/// </summary>
/// <param name="convertRst"></param>
/// <param name="dbProd"></param>
/// <returns></returns>
public PDDProductInfo WXClientToPddConvert(out string convertRst, KJDDBProduct dbProd) public PDDProductInfo WXClientToPddConvert(out string convertRst, KJDDBProduct dbProd)
{ {
convertRst = ""; convertRst = "";
+2 -2
View File
@@ -97,7 +97,7 @@ namespace TemuKJD.BLL.PddApi
public static void GetShopClientInfo(List<ShopLoginInfo> shops = null) public static void GetShopClientInfo(List<ShopLoginInfo> shops = null)
{ {
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
ConcurrentList<ShopLoginInfo> shopList = new ConcurrentList<ShopLoginInfo>(); ConcurrentList<ShopLoginInfo> shopList = new ConcurrentList<ShopLoginInfo>();
if (shops == null) if (shops == null)
@@ -169,7 +169,7 @@ namespace TemuKJD.BLL.PddApi
public static void GetPddClientInfo() public static void GetPddClientInfo()
{ {
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
var url = BaseClass.BuildPDDObjString("shop/get_pdd_client_info"); var url = BaseClass.BuildPDDObjString("shop/get_pdd_client_info");
var data = UserLogin.GetSignaturex(); var data = UserLogin.GetSignaturex();
+1 -1
View File
@@ -297,7 +297,7 @@ namespace TemuKJD.BLL
shop.is_point_shop_expire = BaseRegex.GetBoolJson(ref shopStr, "is_point_shop_expire"); shop.is_point_shop_expire = BaseRegex.GetBoolJson(ref shopStr, "is_point_shop_expire");
shop.expire_time = BaseRegex.GetIntJson(ref shopStr, "expire_time"); shop.expire_time = BaseRegex.GetIntJson(ref shopStr, "expire_time");
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
shop.AntiContents.Clear(); shop.AntiContents.Clear();
//shop.AntiContents.AddRange(JsonHelper.DeserializeJsonToList<string>(jObj["anti_contents"].IsNullOrEmpty() ? "[]" : jObj["anti_contents"].ToString())); //shop.AntiContents.AddRange(JsonHelper.DeserializeJsonToList<string>(jObj["anti_contents"].IsNullOrEmpty() ? "[]" : jObj["anti_contents"].ToString()));
+1 -1
View File
@@ -103,7 +103,7 @@ namespace TemuKJD.BaseForms
setSkinColor(c); setSkinColor(c);
// pdd皮肤颜色 // pdd皮肤颜色
if (BaseClass.MainPath == "binxixi" || BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29pdd" || BaseClass.MainPath == "29wx")
{ {
if (c is Panel && c.BackColor == GlobalConfig.DefaultMainColor) if (c is Panel && c.BackColor == GlobalConfig.DefaultMainColor)
{ {
+1 -1
View File
@@ -104,7 +104,7 @@ namespace TemuKJD.BaseForms
private void LcBaseForm_Load(object sender, EventArgs e) private void LcBaseForm_Load(object sender, EventArgs e)
{ {
if (BaseClass.MainPath == "binxixi" || BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29pdd" || BaseClass.MainPath == "29wx")
{ {
this.pnlTitle.BackColor = GlobalConfig.MainColor; this.pnlTitle.BackColor = GlobalConfig.MainColor;
this.BackColor = GlobalConfig.BorderColor; this.BackColor = GlobalConfig.BorderColor;
+1 -1
View File
@@ -40,7 +40,7 @@ namespace TemuKJD
pnlExtend.Visible = BaseClass.DarenYaoyue; pnlExtend.Visible = BaseClass.DarenYaoyue;
//直接登录上货工具 //直接登录上货工具
if (BaseClass.MainPath != "weixin") // 在此处切换是否显示登录客服选项功能 if (BaseClass.MainPath != "29wx") // 在此处切换是否显示登录客服选项功能
{ {
label1.Visible = true; label1.Visible = true;
pnlChat.Visible = pnlUploadGoods.Visible = false; pnlChat.Visible = pnlUploadGoods.Visible = false;
+80 -66
View File
@@ -13,6 +13,7 @@ using System.Windows.Forms;
using AllBase.Helper; using AllBase.Helper;
using NaiBa.Util.Helper; using NaiBa.Util.Helper;
using System.IO; using System.IO;
using AllBase;
namespace TemuKJD namespace TemuKJD
{ {
@@ -28,74 +29,87 @@ namespace TemuKJD
private void InitForm_Load(object sender, EventArgs e) private void InitForm_Load(object sender, EventArgs e)
{ {
if (File.Exists(System.Environment.CurrentDirectory + "\\YkdChoice.dll")) OpenNewMainForm();
{ return;
this.panel3.Location = new Point(4, 4);
this.panel4.Visible = true;
this.rbPdd.Visible = true;
}
if (File.Exists(System.Environment.CurrentDirectory + "\\WxChoice.dll"))
{
this.panel3.Location = new Point(4, 4);
this.panel4.Visible = true;
this.rbWX.Visible = true;
}
#if DEBUG
this.panel3.Location = new Point(4, 4);
this.panel4.Visible = true;
this.rbPdd.Visible = true;
this.rbWX.Visible = true;
#endif
initFormSettings = ConfigHelper.LoadConfig<InitFormSettings>("initFormSettings");
if (initFormSettings == null)
initFormSettings = new InitFormSettings();
this.chkRemember.Checked = initFormSettings.Remember;
this.rbTemu.Checked = initFormSettings.LoginType.ToLower() == "temu";
this.rbPdd.Checked = initFormSettings.LoginType.ToLower() == "pdd";
this.rbWX.Checked = initFormSettings.LoginType.ToLower() == "wx";
this.rbTemu.CheckedChanged += rbTemu_CheckedChanged;
this.rbPdd.CheckedChanged += rbTemu_CheckedChanged;
this.rbWX.CheckedChanged += rbTemu_CheckedChanged;
if (rbWX.Visible == false || rbPdd.Visible == false)
flowLayoutPanel1.Location = new Point(38, flowLayoutPanel1.Location.Y);
Task.Run(() => // if (File.Exists(System.Environment.CurrentDirectory + "\\YkdChoice.dll"))
{ // {
while (!Work.Initialization.IsCheckFilesFinish || !Program.IsInit || this.progressBarX1.Value < 50) // this.panel3.Location = new Point(4, 4);
{ // this.panel4.Visible = true;
Thread.Sleep(new Random().Next(10, 50)); // this.rbPdd.Visible = true;
// }
// if (File.Exists(System.Environment.CurrentDirectory + "\\WxChoice.dll"))
// {
// this.panel3.Location = new Point(4, 4);
// this.panel4.Visible = true;
// this.rbWX.Visible = true;
// }
//#if DEBUG
// this.panel3.Location = new Point(4, 4);
// this.panel4.Visible = true;
// this.rbPdd.Visible = true;
// this.rbWX.Visible = true;
//#endif
// initFormSettings = ConfigHelper.LoadConfig<InitFormSettings>("initFormSettings");
// if (initFormSettings == null)
// initFormSettings = new InitFormSettings();
// this.chkRemember.Checked = initFormSettings.Remember;
// this.rbTemu.Checked = initFormSettings.LoginType.ToLower() == "temu";
// this.rbPdd.Checked = initFormSettings.LoginType.ToLower() == "pdd";
// this.rbWX.Checked = initFormSettings.LoginType.ToLower() == "wx";
Invoke(new Action(() => // if (initFormSettings.LoginType.ToLower() == "temu")
{ // BaseClass.MainPath = "kuajingda";
this.progressBarX1.Value = Work.Initialization.InitPercent++; // else if (initFormSettings.LoginType.ToLower() == "pdd")
this.progressBarX1.Maximum = 50; // BaseClass.MainPath = "29pdd";
})); // else if (initFormSettings.LoginType.ToLower() == "wx")
if (this.progressBarX1.Value >= 50) // BaseClass.MainPath = "29wx";
Thread.Sleep(300); // else if (initFormSettings.LoginType.ToLower() == "dy")
} // BaseClass.MainPath = "29dy";
Invoke(new Action(() =>
{
btnOK.Visible = true;
}));
#if DEBUG // this.rbTemu.CheckedChanged += rbTemu_CheckedChanged;
Thread.Sleep(2500); // this.rbPdd.CheckedChanged += rbTemu_CheckedChanged;
#else // this.rbWX.CheckedChanged += rbTemu_CheckedChanged;
if (File.Exists(System.Environment.CurrentDirectory + "\\YkdChoice.dll")) // if (rbWX.Visible == false || rbPdd.Visible == false)
{ // flowLayoutPanel1.Location = new Point(38, flowLayoutPanel1.Location.Y);
Thread.Sleep(2500);
} // Task.Run(() =>
#endif // {
if (initFormSettings.Remember) // while (!Work.Initialization.IsCheckFilesFinish || !Program.IsInit || this.progressBarX1.Value < 50)
Thread.Sleep(500); // {
Invoke(new Action(() => // Thread.Sleep(new Random().Next(10, 50));
{
if(initFormSettings.Remember && isChangeType == false) // Invoke(new Action(() =>
{ // {
OpenNewMainForm(); // this.progressBarX1.Value = Work.Initialization.InitPercent++;
} // this.progressBarX1.Maximum = 50;
})); // }));
}); // if (this.progressBarX1.Value >= 50)
// Thread.Sleep(300);
// }
// Invoke(new Action(() =>
// {
// btnOK.Visible = true;
// }));
//#if DEBUG
// Thread.Sleep(2500);
//#else
// if (File.Exists(System.Environment.CurrentDirectory + "\\YkdChoice.dll"))
// {
// Thread.Sleep(2500);
// }
//#endif
// if (initFormSettings.Remember)
// Thread.Sleep(500);
// Invoke(new Action(() =>
// {
// if(initFormSettings.Remember && isChangeType == false)
// {
// OpenNewMainForm();
// }
// }));
// });
} }
bool isOpen = false; bool isOpen = false;
@@ -112,7 +126,7 @@ namespace TemuKJD
} }
this.Hide(); this.Hide();
isOpen = true; isOpen = true;
new MainForm(initFormSettings.LoginType).ShowDialog(); new MainForm().ShowDialog();
} }
catch (Exception ex) catch (Exception ex)
{ {
@@ -63,7 +63,7 @@ namespace TemuKJD.KJDForms.SystemForms
private void SystemRemoveRestrictionsForm_Load(object sender, EventArgs e) private void SystemRemoveRestrictionsForm_Load(object sender, EventArgs e)
{ {
if (AllBase.BaseClass.MainPath == "weixin") if (AllBase.BaseClass.MainPath == "29wx")
{ {
this.ucCheckBox1.Visible = true; this.ucCheckBox1.Visible = true;
} }
+22 -26
View File
@@ -57,7 +57,7 @@ namespace TemuKJD
public static int ProcessCount = 0; public static int ProcessCount = 0;
public static MainForm instance; public static MainForm instance;
public string LoginType; //public string LoginType;
private Point mouseOffset;//记录鼠标指针的坐标 private Point mouseOffset;//记录鼠标指针的坐标
private bool isMouseDown;//记录鼠标左键是否按下 private bool isMouseDown;//记录鼠标左键是否按下
public delegate void delegateShow(Form nf); public delegate void delegateShow(Form nf);
@@ -146,30 +146,26 @@ namespace TemuKJD
//SetFormRoundRectRgn(this, 7); //SetFormRoundRectRgn(this, 7);
} }
public MainForm(string loginType = "Temu") public MainForm()
{ {
InitializeComponent(); InitializeComponent();
LoginType = loginType; if (BaseClass.MainPath == "29pdd")
if (loginType == "Pdd") {
{
BaseClass.MainPath = "binxixi";
GlobalConfig.MainColor = GlobalConfig.PddMainColor; GlobalConfig.MainColor = GlobalConfig.PddMainColor;
GlobalConfig.MainColorLight = GlobalConfig.PddMainColorLight; GlobalConfig.MainColorLight = GlobalConfig.PddMainColorLight;
GlobalConfig.BorderColor = GlobalConfig.PddBorderColor; GlobalConfig.BorderColor = GlobalConfig.PddBorderColor;
this.pnlJit.Visible = false; this.pnlJit.Visible = false;
} }
else if (loginType == "Wx") else if (BaseClass.MainPath == "29wx")
{ {
BaseClass.MainPath = "weixin";
GlobalConfig.MainColor = GlobalConfig.WeiXinMainColor; GlobalConfig.MainColor = GlobalConfig.WeiXinMainColor;
GlobalConfig.MainColorLight = GlobalConfig.WeiXinMainColorLight; GlobalConfig.MainColorLight = GlobalConfig.WeiXinMainColorLight;
GlobalConfig.BorderColor = GlobalConfig.WeiXinBorderColor; GlobalConfig.BorderColor = GlobalConfig.WeiXinBorderColor;
this.pnlJit.Visible = false; this.pnlJit.Visible = false;
} }
else if (loginType == "Dy") else if (BaseClass.MainPath == "29dy")
{ {
BaseClass.MainPath = "douyin";
this.pnlJit.Visible = false; this.pnlJit.Visible = false;
} }
@@ -230,7 +226,7 @@ namespace TemuKJD
private void MainForm_Load(object sender, EventArgs e) private void MainForm_Load(object sender, EventArgs e)
{ {
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
BaseClass.Ico = Icon.FromHandle(Properties.Resources.pdd_icon.GetHicon()); BaseClass.Ico = Icon.FromHandle(Properties.Resources.pdd_icon.GetHicon());
BaseClass.LogoImage = Properties.Resources.pdd_logo; BaseClass.LogoImage = Properties.Resources.pdd_logo;
@@ -240,7 +236,7 @@ namespace TemuKJD
BaseClass.ToolName = "29供应链 - 多多管理工具"; BaseClass.ToolName = "29供应链 - 多多管理工具";
} }
if (BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29wx")
{ {
BaseClass.Ico = Icon.FromHandle(Properties.Resources.weixin_icon.GetHicon()); BaseClass.Ico = Icon.FromHandle(Properties.Resources.weixin_icon.GetHicon());
BaseClass.LogoImage = Properties.Resources.weixin_logo; BaseClass.LogoImage = Properties.Resources.weixin_logo;
@@ -862,7 +858,7 @@ namespace TemuKJD
} }
ShowMainPanel(shopForm as ShopForm, sender as Panel); ShowMainPanel(shopForm as ShopForm, sender as Panel);
} }
else if (BaseClass.MainPath == "binxixi") else if (BaseClass.MainPath == "29pdd")
{ {
if (shopForm == null) if (shopForm == null)
{ {
@@ -870,7 +866,7 @@ namespace TemuKJD
} }
ShowMainPanel(shopForm as A_PddShopForm, sender as Panel); ShowMainPanel(shopForm as A_PddShopForm, sender as Panel);
} }
else if (BaseClass.MainPath == "weixin") else if (BaseClass.MainPath == "29wx")
{ {
if (shopForm == null) if (shopForm == null)
{ {
@@ -891,15 +887,7 @@ namespace TemuKJD
} }
ShowMainPanel(adminForm as AdminForm, sender as Panel); ShowMainPanel(adminForm as AdminForm, sender as Panel);
} }
else if (BaseClass.MainPath == "binxixi") else if (BaseClass.MainPath == "29dy")
{
if (adminForm == null)
{
adminForm = new PDDAdminForm();
}
ShowMainPanel(adminForm as PDDAdminForm, sender as Panel);
}
else if (BaseClass.MainPath == "douyin")
{ {
//if (adminForm == null) //if (adminForm == null)
//{ //{
@@ -907,7 +895,15 @@ namespace TemuKJD
//} //}
//ShowMainPanel(adminForm as PDDAdminForm, sender as Panel); //ShowMainPanel(adminForm as PDDAdminForm, sender as Panel);
} }
else if (BaseClass.MainPath == "weixin") else if (BaseClass.MainPath == "29pdd")
{
if (adminForm == null)
{
adminForm = new PDDAdminForm();
}
ShowMainPanel(adminForm as PDDAdminForm, sender as Panel);
}
else if (BaseClass.MainPath == "29wx")
{ {
if (adminForm == null) if (adminForm == null)
{ {
@@ -928,7 +924,7 @@ namespace TemuKJD
} }
ShowMainPanel(uploadForm as ProductForm, sender as Panel); ShowMainPanel(uploadForm as ProductForm, sender as Panel);
} }
else if (BaseClass.MainPath == "binxixi") else if (BaseClass.MainPath == "29pdd")
{ {
if (uploadForm == null) if (uploadForm == null)
{ {
@@ -936,7 +932,7 @@ namespace TemuKJD
} }
ShowMainPanel(uploadForm as PDDProductForm, sender as Panel); ShowMainPanel(uploadForm as PDDProductForm, sender as Panel);
} }
else if (BaseClass.MainPath == "weixin") else if (BaseClass.MainPath == "29wx")
{ {
if (uploadForm == null) if (uploadForm == null)
{ {
@@ -501,7 +501,7 @@ namespace TemuKJD.PDDForms.AdminForms
//public Func<object, string, string, request, bool> BeforeResourceLoadEvent; // sender, requestUrl, postData, request, true(表示取消执行) //public Func<object, string, string, request, bool> BeforeResourceLoadEvent; // sender, requestUrl, postData, request, true(表示取消执行)
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request) private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
{ {
if (BaseClass.MainPath == "binxixi" && BaseClass.UsePddWorkbanch && !shop.Cookies.Contains("windows_1")) if (BaseClass.MainPath == "29pdd" && BaseClass.UsePddWorkbanch && !shop.Cookies.Contains("windows_1"))
{ {
var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"; var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
//ua = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36"; //ua = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36";
@@ -97,7 +97,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
lblGroup.Visible = cmbGroup.Visible = btnSetGroup.Visible = false; lblGroup.Visible = cmbGroup.Visible = btnSetGroup.Visible = false;
} }
if (BaseClass.MainPath != "binxixi") if (BaseClass.MainPath != "29pdd")
{ {
//this.dgvDbProduct.Columns["col_edit"].Visible = false; //this.dgvDbProduct.Columns["col_edit"].Visible = false;
this.dgvDbProduct.Columns["colExtCodePrice"].Visible = false; this.dgvDbProduct.Columns["colExtCodePrice"].Visible = false;
@@ -593,7 +593,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
case "详情": case "详情":
case "编辑/详情": case "编辑/详情":
PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct); PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct);
if (BaseClass.MainPath != "binxixi") if (BaseClass.MainPath != "29pdd")
{ {
editForm.pnlSkuOption.Visible = false; editForm.pnlSkuOption.Visible = false;
editForm.txtProductName.ReadOnly = true; editForm.txtProductName.ReadOnly = true;
@@ -29,7 +29,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void PDDDBProdUserSelectCacheForm_Load(object sender, EventArgs e) private void PDDDBProdUserSelectCacheForm_Load(object sender, EventArgs e)
{ {
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
dgvSelectProduct.Columns["colBound"].Visible = false; dgvSelectProduct.Columns["colBound"].Visible = false;
} }
@@ -9780,7 +9780,7 @@ Content-Type: image/jpeg
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request) private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
{ {
var shop = (sender as ChromiumWebBrowser).Tag as ShopLoginInfo; var shop = (sender as ChromiumWebBrowser).Tag as ShopLoginInfo;
if (BaseClass.MainPath == "binxixi" && BaseClass.UsePddWorkbanch && !(shop?.Cookies).ParseToString().Contains("windows_1")) if (BaseClass.MainPath == "29pdd" && BaseClass.UsePddWorkbanch && !(shop?.Cookies).ParseToString().Contains("windows_1"))
{ {
var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"; var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
//ua = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36"; //ua = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36";
@@ -610,7 +610,7 @@ namespace TemuKJD.PDDForms.ShopForms
//public Func<object, string, string, request, bool> BeforeResourceLoadEvent; // sender, requestUrl, postData, request, true(表示取消执行) //public Func<object, string, string, request, bool> BeforeResourceLoadEvent; // sender, requestUrl, postData, request, true(表示取消执行)
private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request) private bool RequestHandler_BeforeResourceLoad(object sender, string url, string postData, IRequest request)
{ {
if (BaseClass.MainPath == "binxixi" && BaseClass.UsePddWorkbanch && !shop.Cookies.Contains("windows_1")) if (BaseClass.MainPath == "29pdd" && BaseClass.UsePddWorkbanch && !shop.Cookies.Contains("windows_1"))
{ {
var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36"; var ua = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
//ua = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36"; //ua = "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.5.40.8 Safari/537.36";
+2 -2
View File
@@ -204,7 +204,7 @@ namespace TemuKJD
Thread.Sleep(1000); Thread.Sleep(1000);
} }
if (BaseClass.MainPath != "weixin") // 微信才读取违规商品信息 if (BaseClass.MainPath != "29wx") // 微信才读取违规商品信息
return; return;
new WXProdViolationManage().GetShopProdViolation(); new WXProdViolationManage().GetShopProdViolation();
@@ -228,7 +228,7 @@ namespace TemuKJD
return; return;
} }
if (BaseClass.MainPath != "weixin") // 微信读取 if (BaseClass.MainPath != "29wx") // 微信读取
return; return;
var url = BaseClass.BuildObjString("product/is_get_wx_recommend_hot_prod"); var url = BaseClass.BuildObjString("product/is_get_wx_recommend_hot_prod");
+2 -2
View File
@@ -786,7 +786,7 @@ namespace TemuKJD.ToolForms
{ {
if (platformType == "Pinduoduo" || string.IsNullOrEmpty(platformType)) if (platformType == "Pinduoduo" || string.IsNullOrEmpty(platformType))
GetPinDuoduoProd(); GetPinDuoduoProd();
else if (platformType == "douyin") else if (platformType == "Douyin")
GetDyProd(); GetDyProd();
} }
@@ -986,7 +986,7 @@ namespace TemuKJD.ToolForms
} }
else if (cmbPlatformType.Text == "抖音") else if (cmbPlatformType.Text == "抖音")
{ {
platformType = "douyin"; platformType = "Douyin";
} }
else if (cmbPlatformType.Text == "淘宝") else if (cmbPlatformType.Text == "淘宝")
{ {
+2 -2
View File
@@ -38,13 +38,13 @@ namespace TemuKJD.UserForm
private void LoginForm_Load(object sender, EventArgs e) private void LoginForm_Load(object sender, EventArgs e)
{ {
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
this.pnlLoginBg.Style.BackgroundImage = Properties.Resources.pdd_bg; this.pnlLoginBg.Style.BackgroundImage = Properties.Resources.pdd_bg;
this.pnlLoginBg.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Stretch; this.pnlLoginBg.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Stretch;
this.pbLogo.Image = Properties.Resources.pdd_logo; this.pbLogo.Image = Properties.Resources.pdd_logo;
} }
if (BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29wx")
{ {
this.pnlLoginBg.Style.BackgroundImage = Properties.Resources.weixin_bg; this.pnlLoginBg.Style.BackgroundImage = Properties.Resources.weixin_bg;
this.pnlLoginBg.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Stretch; this.pnlLoginBg.Style.BackgroundImagePosition = DevComponents.DotNetBar.eBackgroundImagePosition.Stretch;
@@ -56,7 +56,7 @@ namespace TemuKJD.WXForms.ProductForms
tableLayoutPanel1.SetColumn(lblSourceType, 2); tableLayoutPanel1.SetColumn(lblSourceType, 2);
tableLayoutPanel1.SetColumn(cmbSourceType, 3); tableLayoutPanel1.SetColumn(cmbSourceType, 3);
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
chkCatBoundLessThan.Visible = false; chkCatBoundLessThan.Visible = false;
chkCatBoundMoreThan.Visible = false; chkCatBoundMoreThan.Visible = false;
@@ -83,7 +83,7 @@ namespace TemuKJD.WXForms.ProductForms
this.dgvDbProduct.Columns["colPriceText"].Visible = true; this.dgvDbProduct.Columns["colPriceText"].Visible = true;
lblGroup.Visible = false; lblGroup.Visible = false;
} }
if (BaseClass.MainPath != "binxixi") if (BaseClass.MainPath != "29pdd")
{ {
this.dgvDbProduct.Columns["colExtCodePrice"].Visible = false; this.dgvDbProduct.Columns["colExtCodePrice"].Visible = false;
this.dgvDbProduct.Columns["colEdit"].Visible = false; this.dgvDbProduct.Columns["colEdit"].Visible = false;
@@ -342,9 +342,9 @@ namespace TemuKJD.WXForms.ProductForms
"&search_prod_name=" + txtProdName.Text.Trim() + "&search_prod_name=" + txtProdName.Text.Trim() +
"&wx_safe_status=" + cmbWxSafe.Text.Trim().Replace("安全+未校验", "安全商品,未校验").Replace("违规商品", ""); "&wx_safe_status=" + cmbWxSafe.Text.Trim().Replace("安全+未校验", "安全商品,未校验").Replace("违规商品", "");
data += "&add_user_name=" + BaseClass.UserName; data += "&add_user_name=" + BaseClass.UserName;
if (BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29wx")
data += "&ban_wx=0"; data += "&ban_wx=0";
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
data += "&ban_pdd=0"; data += "&ban_pdd=0";
if (cmbRelation.Text == "否") if (cmbRelation.Text == "否")
data += "&is_relation=0"; data += "&is_relation=0";
@@ -587,7 +587,7 @@ namespace TemuKJD.WXForms.ProductForms
case "详情": case "详情":
case "编辑/详情": case "编辑/详情":
//PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct); //PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct);
//if (BaseClass.MainPath != "binxixi") //if (BaseClass.MainPath != "29pdd")
//{ //{
// editForm.pnlSkuOption.Visible = false; // editForm.pnlSkuOption.Visible = false;
// editForm.txtProductName.ReadOnly = true; // editForm.txtProductName.ReadOnly = true;
@@ -54,7 +54,7 @@ namespace TemuKJD.WXForms.ProductForms
private void ProductListForm_Load(object sender, EventArgs e) private void ProductListForm_Load(object sender, EventArgs e)
{ {
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
{ {
chkCatBoundLessThan.Visible = false; chkCatBoundLessThan.Visible = false;
chkCatBoundMoreThan.Visible = false; chkCatBoundMoreThan.Visible = false;
@@ -83,7 +83,7 @@ namespace TemuKJD.WXForms.ProductForms
this.dgvDbProduct.Columns["colPriceText"].Visible = true; this.dgvDbProduct.Columns["colPriceText"].Visible = true;
lblGroup.Visible = false; lblGroup.Visible = false;
} }
if (BaseClass.MainPath != "binxixi") if (BaseClass.MainPath != "29pdd")
{ {
this.dgvDbProduct.Columns["colExtCodePrice"].Visible = false; this.dgvDbProduct.Columns["colExtCodePrice"].Visible = false;
this.dgvDbProduct.Columns["colEdit"].Visible = false; this.dgvDbProduct.Columns["colEdit"].Visible = false;
@@ -415,9 +415,9 @@ namespace TemuKJD.WXForms.ProductForms
addUserName = BaseClass.ParentAuthority.Contains("机会商品采集") ? ("admin," + BaseClass.ParentUserName) : "admin"; addUserName = BaseClass.ParentAuthority.Contains("机会商品采集") ? ("admin," + BaseClass.ParentUserName) : "admin";
data += "&add_user_name=" + addUserName; data += "&add_user_name=" + addUserName;
if (BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29wx")
data += "&ban_wx=0"; data += "&ban_wx=0";
if (BaseClass.MainPath == "binxixi") if (BaseClass.MainPath == "29pdd")
data += "&ban_pdd=0"; data += "&ban_pdd=0";
if (cmbRelation.Text == "否") if (cmbRelation.Text == "否")
data += "&is_relation=0"; data += "&is_relation=0";
@@ -664,7 +664,7 @@ namespace TemuKJD.WXForms.ProductForms
case "详情": case "详情":
case "编辑/详情": case "编辑/详情":
//PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct); //PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct);
//if (BaseClass.MainPath != "binxixi") //if (BaseClass.MainPath != "29pdd")
//{ //{
// editForm.pnlSkuOption.Visible = false; // editForm.pnlSkuOption.Visible = false;
// editForm.txtProductName.ReadOnly = true; // editForm.txtProductName.ReadOnly = true;
@@ -345,7 +345,7 @@ namespace TemuKJD.WXForms.ShopForms
public static void GetShopDefaultAddress(List<ShopLoginInfo> shopGetAddressList = null) public static void GetShopDefaultAddress(List<ShopLoginInfo> shopGetAddressList = null)
{ {
if (BaseClass.MainPath == "weixin") if (BaseClass.MainPath == "29wx")
{ {
if (shopGetAddressList == null) if (shopGetAddressList == null)
{ {
+3 -3
View File
@@ -358,7 +358,7 @@
this.cmbGroup.DropDownWidth = 1; this.cmbGroup.DropDownWidth = 1;
this.cmbGroup.FormattingEnabled = true; this.cmbGroup.FormattingEnabled = true;
this.cmbGroup.IntegralHeight = false; this.cmbGroup.IntegralHeight = false;
this.cmbGroup.Location = new System.Drawing.Point(385, 5); this.cmbGroup.Location = new System.Drawing.Point(385, 8);
this.cmbGroup.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4); this.cmbGroup.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
this.cmbGroup.Name = "cmbGroup"; this.cmbGroup.Name = "cmbGroup";
this.cmbGroup.Size = new System.Drawing.Size(74, 25); this.cmbGroup.Size = new System.Drawing.Size(74, 25);
@@ -384,7 +384,7 @@
this.cmbNotes.DropDownWidth = 1; this.cmbNotes.DropDownWidth = 1;
this.cmbNotes.FormattingEnabled = true; this.cmbNotes.FormattingEnabled = true;
this.cmbNotes.IntegralHeight = false; this.cmbNotes.IntegralHeight = false;
this.cmbNotes.Location = new System.Drawing.Point(276, 5); this.cmbNotes.Location = new System.Drawing.Point(276, 8);
this.cmbNotes.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4); this.cmbNotes.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
this.cmbNotes.Name = "cmbNotes"; this.cmbNotes.Name = "cmbNotes";
this.cmbNotes.Size = new System.Drawing.Size(74, 25); this.cmbNotes.Size = new System.Drawing.Size(74, 25);
@@ -517,7 +517,7 @@
this.cmbSubAccount.DropDownWidth = 1; this.cmbSubAccount.DropDownWidth = 1;
this.cmbSubAccount.FormattingEnabled = true; this.cmbSubAccount.FormattingEnabled = true;
this.cmbSubAccount.IntegralHeight = false; this.cmbSubAccount.IntegralHeight = false;
this.cmbSubAccount.Location = new System.Drawing.Point(506, 5); this.cmbSubAccount.Location = new System.Drawing.Point(506, 8);
this.cmbSubAccount.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4); this.cmbSubAccount.Margin = new System.Windows.Forms.Padding(0, 0, 0, 4);
this.cmbSubAccount.Name = "cmbSubAccount"; this.cmbSubAccount.Name = "cmbSubAccount";
this.cmbSubAccount.Size = new System.Drawing.Size(74, 25); this.cmbSubAccount.Size = new System.Drawing.Size(74, 25);
@@ -1185,7 +1185,7 @@ namespace TemuKJD.WXForms.TalkForms
case "详情": case "详情":
case "编辑/详情": case "编辑/详情":
//PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct); //PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct);
//if (BaseClass.MainPath != "binxixi") //if (BaseClass.MainPath != "29pdd")
//{ //{
// editForm.pnlSkuOption.Visible = false; // editForm.pnlSkuOption.Visible = false;
// editForm.txtProductName.ReadOnly = true; // editForm.txtProductName.ReadOnly = true;
+35 -2
View File
@@ -23,8 +23,41 @@ namespace Update
/// 应用程序的主入口点。 /// 应用程序的主入口点。
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main() static void Main(string[] args)
{ {
if (args.Length > 0)
{
try
{
var arr = args[0].TrimStart('-').Split(new string[] { "\r\n" }, StringSplitOptions.RemoveEmptyEntries);
if (arr.Length > 3)
{
softName = arr[0];
oldVersion = Convert.ToInt32(arr[1]);
newVersion = Convert.ToInt32(arr[2]);
updateUrl = arr[3];
if (oldVersion == 0 || string.IsNullOrEmpty(softName) || string.IsNullOrEmpty(updateUrl))
return;
// 如果有新版本,就继续升级
if (newVersion > oldVersion)
{
//Application.Current.Shutdown(); // 强制升级
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainForm());
}
// 仍然删除旧版数据防止残留
if (File.Exists("UpdateConfig.ini"))
File.Delete("UpdateConfig.ini");
return;
}
}
catch (Exception ex) { }
}
if (File.Exists("UpdateConfig.ini")) if (File.Exists("UpdateConfig.ini"))
{ {
try try
@@ -193,7 +226,7 @@ namespace Update
try try
{ {
WebClientUtils webClient = new WebClientUtils(); WebClientUtils webClient = new WebClientUtils();
webClient.Timeout = 600; webClient.Timeout = 1200; // 20分钟
if (File.Exists(FilePath)) if (File.Exists(FilePath))
File.Delete(FilePath); File.Delete(FilePath);
webClient.DownloadProgressChanged += WebClient_DownloadProgressChanged; webClient.DownloadProgressChanged += WebClient_DownloadProgressChanged;
+9 -7
View File
@@ -320,7 +320,7 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
// while (true) // while (true)
{ {
string updatefilepath = System.Environment.CurrentDirectory + "\\Update.exe"; string updatefilepath = System.Environment.CurrentDirectory + "\\Update.exe";
var url = BaseClass.BuildObjString("update/get_update"); var url = BaseClass.BuildDefaultObjString("update/get_update_new");
var data = UserLogin.GetSignaturex(); var data = UserLogin.GetSignaturex();
var html = GetHtml.PostUtf8(url, data); var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -329,8 +329,10 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
var updateExeChk = BaseRegex.GetStringJson(ref html, "exe_check").ParseToString(); var updateExeChk = BaseRegex.GetStringJson(ref html, "exe_check").ParseToString();
var updateExeAddress = BaseRegex.GetStringJson(ref html, "exe_address"); var updateExeAddress = BaseRegex.GetStringJson(ref html, "exe_address");
var updateFileAddress = BaseRegex.GetStringJson(ref html, "file_address"); var updateFileAddress = BaseRegex.GetStringJson(ref html, "file_address");
updateFileAddress = updateFileAddress.Replace("/Update", "/Update" + BaseClass.MainPath);
var newVersion = BaseRegex.GetIntJson(ref html, "next_version").ParseToInt(); var newVersion = BaseRegex.GetIntJson(ref html, "next_version").ParseToInt();
if (File.Exists(updatefilepath)) if (File.Exists(updatefilepath))
{ {
string fc = BaseClass.GetFileMd5(updatefilepath); string fc = BaseClass.GetFileMd5(updatefilepath);
@@ -348,13 +350,13 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
{ {
if (File.Exists(updatefilepath)) if (File.Exists(updatefilepath))
{ {
File.WriteAllText(System.Environment.CurrentDirectory + "\\UpdateConfig.ini", string fileName = Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName);
"TemuKJD\r\n" +
BaseClass.VersionCount + "\r\n" +
newVersion + "\r\n" +
updateFileAddress);
Process.Start(updatefilepath); string arguments = "-" + fileName + "\r\n" + BaseClass.VersionCount + "\r\n" + newVersion + "\r\n" + updateFileAddress;
File.WriteAllText(System.Environment.CurrentDirectory + "\\UpdateConfig.ini", arguments);
Process.Start(updatefilepath, arguments);
} }
} }
catch (Exception ex) catch (Exception ex)