diff --git a/.gitignore b/.gitignore
index b3ca126..ded2f31 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@ packages
bin
*.rar
*.zip
+/Update/Update/*.user
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index 9c8377e..29b14de 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,7 +27,9 @@ namespace AllBase
///
/// 版本ID
///
- 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;
///
@@ -41,7 +43,6 @@ namespace AllBase
public static Image LoginImage = null;
public static Image LogoImage = null;
public static Icon Ico = null;
- public static string MainPath = "kuajingda";
public static bool UsePddWorkbanch = true;
public static bool NoRegedit = false;
public static bool IsPinduoduo = false;
@@ -721,6 +722,11 @@ namespace AllBase
string c = ((int)y).ToString();
return GetMd5(c); //返回签名的MD5结果
}
+
+ public static string BuildDefaultObjString(string file, bool IsLoginDef = false)
+ {
+ return LoginApiUrl + "/" + file + "?obj=" + "/" + file;
+ }
///
/// 生成OBJ路径
///
@@ -735,23 +741,21 @@ namespace AllBase
//return LoginApiUrl + "index.php?obj=" + BaseClass.MainPath + "/" + file;
//http://localhost:8000/user/user_login
- //pdd相关操作
- if (BaseClass.MainPath == "binxixi")
+ if (BaseClass.MainPath == "29pdd")
{
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;
}
- if (BaseClass.MainPath == "weixin")
+ if (BaseClass.MainPath == "29wx")
{
return LoginApiUrl + "/wxxd_" + file + "?obj=" + BaseClass.MainPath + "/wxxd_" + file;
}
return LoginApiUrl + "/" + file+ "?obj=" + BaseClass.MainPath + "/" + file;
}
-
public static string BuildPDDObjString(string file, bool IsLoginDef = false)
{
return LoginApiUrl + "/bxx_" + file + "?obj=" + BaseClass.MainPath + "/bxx_" + file;
diff --git a/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs b/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs
index 47383d6..1c44fc1 100644
--- a/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs
+++ b/KJDService/KJD_WebService/BLL/KJD/UpadteManage.cs
@@ -29,6 +29,9 @@ namespace KJD_Web.BLL
var UpdateExeChk = System.Configuration.ConfigurationManager.ConnectionStrings["UpdateExeChk"].ConnectionString;
var LowVersion = System.Configuration.ConfigurationManager.ConnectionStrings["LowVersion"].ConnectionString;
+ serverVersion = "1115";
+ UpdateFiles = "http://weidian.e57.cn/kjd_update/Update1115.zip";
+
if (version > LowVersion.ParseToInt())
{
return "{\"code\":200,\"msg\":\"success\",\"next_version\":" + serverVersion + ",\"exe_check\":\"" + UpdateExeChk +
@@ -45,5 +48,42 @@ namespace KJD_Web.BLL
}
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\":\"未知错误\"}";
+ }
}
}
\ No newline at end of file
diff --git a/KJDService/KJD_WebService/UpdateService.asmx.cs b/KJDService/KJD_WebService/UpdateService.asmx.cs
index 8cace63..a247605 100644
--- a/KJDService/KJD_WebService/UpdateService.asmx.cs
+++ b/KJDService/KJD_WebService/UpdateService.asmx.cs
@@ -54,7 +54,7 @@ namespace KJD_Web
}
}
-
+
[WebMethod]
public void get_update()
{
@@ -66,5 +66,17 @@ namespace KJD_Web
Context.Response.Write(result);
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();
+ }
}
}
diff --git a/KJDService/KJD_WebService/Web.config b/KJDService/KJD_WebService/Web.config
index 0d6067e..e8df77c 100644
--- a/KJDService/KJD_WebService/Web.config
+++ b/KJDService/KJD_WebService/Web.config
@@ -11,8 +11,8 @@
-
-
+
+
diff --git a/PackTools/Publish/Publish/Form1.cs b/PackTools/Publish/Publish/Form1.cs
index cbd391c..f031b76 100644
--- a/PackTools/Publish/Publish/Form1.cs
+++ b/PackTools/Publish/Publish/Form1.cs
@@ -23,10 +23,16 @@ namespace Publish
{
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 filePathLst = new List();
- 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)
{
filePathLst.Add(AppDomain.CurrentDomain.SetupInformation.ApplicationBase + item.ToString());
diff --git a/TEMUKJD/BLL/PDDProdFormConverter.cs b/TEMUKJD/BLL/PDDProdFormConverter.cs
index 5cfafb5..773f3ee 100644
--- a/TEMUKJD/BLL/PDDProdFormConverter.cs
+++ b/TEMUKJD/BLL/PDDProdFormConverter.cs
@@ -866,7 +866,12 @@ namespace TemuKJD.BLL
}
}
-
+ ///
+ /// 微信店铺采集转拼多多
+ ///
+ ///
+ ///
+ ///
public PDDProductInfo WXProdToPddConvert(out string convertRst, KJDDBProduct dbProd)
{
convertRst = "";
@@ -1220,7 +1225,12 @@ namespace TemuKJD.BLL
}
}
-
+ ///
+ /// 1688网页端采集转拼多多
+ ///
+ ///
+ ///
+ ///
public PDDProductInfo _1688ClientToPddConvert(out string convertRst, KJDDBProduct dbProd)
{
convertRst = "";
@@ -1565,7 +1575,7 @@ namespace TemuKJD.BLL
}
///
- /// 1688外部数据转拼多多
+ /// 1688外部数据转拼多多(万象工具)
///
///
///
@@ -1770,6 +1780,17 @@ namespace TemuKJD.BLL
prodInfo.detail.size_spec_id = null;
prodInfo.detail.sku = new List();
+ 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)
{
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_type = null;
@@ -1920,6 +1953,12 @@ namespace TemuKJD.BLL
}
}
+ ///
+ /// 微信商城手机版转拼多多
+ ///
+ ///
+ ///
+ ///
public PDDProductInfo WXClientToPddConvert(out string convertRst, KJDDBProduct dbProd)
{
convertRst = "";
diff --git a/TEMUKJD/BLL/Pdd/PddApiHelper.cs b/TEMUKJD/BLL/Pdd/PddApiHelper.cs
index 5c882e5..900f227 100644
--- a/TEMUKJD/BLL/Pdd/PddApiHelper.cs
+++ b/TEMUKJD/BLL/Pdd/PddApiHelper.cs
@@ -97,7 +97,7 @@ namespace TemuKJD.BLL.PddApi
public static void GetShopClientInfo(List shops = null)
{
- if (BaseClass.MainPath == "binxixi")
+ if (BaseClass.MainPath == "29pdd")
{
ConcurrentList shopList = new ConcurrentList();
if (shops == null)
@@ -169,7 +169,7 @@ namespace TemuKJD.BLL.PddApi
public static void GetPddClientInfo()
{
- if (BaseClass.MainPath == "binxixi")
+ if (BaseClass.MainPath == "29pdd")
{
var url = BaseClass.BuildPDDObjString("shop/get_pdd_client_info");
var data = UserLogin.GetSignaturex();
diff --git a/TEMUKJD/BLL/ShopBLL.cs b/TEMUKJD/BLL/ShopBLL.cs
index 980393e..142d886 100644
--- a/TEMUKJD/BLL/ShopBLL.cs
+++ b/TEMUKJD/BLL/ShopBLL.cs
@@ -297,7 +297,7 @@ namespace TemuKJD.BLL
shop.is_point_shop_expire = BaseRegex.GetBoolJson(ref shopStr, "is_point_shop_expire");
shop.expire_time = BaseRegex.GetIntJson(ref shopStr, "expire_time");
- if (BaseClass.MainPath == "binxixi")
+ if (BaseClass.MainPath == "29pdd")
{
shop.AntiContents.Clear();
//shop.AntiContents.AddRange(JsonHelper.DeserializeJsonToList(jObj["anti_contents"].IsNullOrEmpty() ? "[]" : jObj["anti_contents"].ToString()));
diff --git a/TEMUKJD/BaseForms/BaseForm.cs b/TEMUKJD/BaseForms/BaseForm.cs
index 171cf72..af9e15d 100644
--- a/TEMUKJD/BaseForms/BaseForm.cs
+++ b/TEMUKJD/BaseForms/BaseForm.cs
@@ -103,7 +103,7 @@ namespace TemuKJD.BaseForms
setSkinColor(c);
// pdd皮肤颜色
- if (BaseClass.MainPath == "binxixi" || BaseClass.MainPath == "weixin")
+ if (BaseClass.MainPath == "29pdd" || BaseClass.MainPath == "29wx")
{
if (c is Panel && c.BackColor == GlobalConfig.DefaultMainColor)
{
diff --git a/TEMUKJD/BaseForms/BaseGeneralForm.cs b/TEMUKJD/BaseForms/BaseGeneralForm.cs
index e81611c..44e3073 100644
--- a/TEMUKJD/BaseForms/BaseGeneralForm.cs
+++ b/TEMUKJD/BaseForms/BaseGeneralForm.cs
@@ -104,7 +104,7 @@ namespace TemuKJD.BaseForms
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.BackColor = GlobalConfig.BorderColor;
diff --git a/TEMUKJD/ChangeForm.cs b/TEMUKJD/ChangeForm.cs
index 3cfd191..1f6049f 100644
--- a/TEMUKJD/ChangeForm.cs
+++ b/TEMUKJD/ChangeForm.cs
@@ -40,7 +40,7 @@ namespace TemuKJD
pnlExtend.Visible = BaseClass.DarenYaoyue;
//直接登录上货工具
- if (BaseClass.MainPath != "weixin") // 在此处切换是否显示登录客服选项功能
+ if (BaseClass.MainPath != "29wx") // 在此处切换是否显示登录客服选项功能
{
label1.Visible = true;
pnlChat.Visible = pnlUploadGoods.Visible = false;
diff --git a/TEMUKJD/InitForm.cs b/TEMUKJD/InitForm.cs
index 0de2ee2..29a2d70 100644
--- a/TEMUKJD/InitForm.cs
+++ b/TEMUKJD/InitForm.cs
@@ -13,6 +13,7 @@ using System.Windows.Forms;
using AllBase.Helper;
using NaiBa.Util.Helper;
using System.IO;
+using AllBase;
namespace TemuKJD
{
@@ -28,74 +29,87 @@ namespace TemuKJD
private void InitForm_Load(object sender, EventArgs e)
{
- if (File.Exists(System.Environment.CurrentDirectory + "\\YkdChoice.dll"))
- {
- 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");
- 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);
+ OpenNewMainForm();
+ return;
- Task.Run(() =>
- {
- while (!Work.Initialization.IsCheckFilesFinish || !Program.IsInit || this.progressBarX1.Value < 50)
- {
- Thread.Sleep(new Random().Next(10, 50));
+// if (File.Exists(System.Environment.CurrentDirectory + "\\YkdChoice.dll"))
+// {
+// 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");
+// 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(() =>
- {
- 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 (initFormSettings.LoginType.ToLower() == "temu")
+// BaseClass.MainPath = "kuajingda";
+// else if (initFormSettings.LoginType.ToLower() == "pdd")
+// BaseClass.MainPath = "29pdd";
+// else if (initFormSettings.LoginType.ToLower() == "wx")
+// BaseClass.MainPath = "29wx";
+// else if (initFormSettings.LoginType.ToLower() == "dy")
+// BaseClass.MainPath = "29dy";
-#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();
- }
- }));
- });
+// 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(() =>
+// {
+// while (!Work.Initialization.IsCheckFilesFinish || !Program.IsInit || this.progressBarX1.Value < 50)
+// {
+// Thread.Sleep(new Random().Next(10, 50));
+
+// Invoke(new Action(() =>
+// {
+// 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;
@@ -112,7 +126,7 @@ namespace TemuKJD
}
this.Hide();
isOpen = true;
- new MainForm(initFormSettings.LoginType).ShowDialog();
+ new MainForm().ShowDialog();
}
catch (Exception ex)
{
diff --git a/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.cs b/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.cs
index 7ddb531..1080a8e 100644
--- a/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.cs
+++ b/TEMUKJD/KJDForms/SystemForms/SystemRemoveRestrictionsForm.cs
@@ -63,7 +63,7 @@ namespace TemuKJD.KJDForms.SystemForms
private void SystemRemoveRestrictionsForm_Load(object sender, EventArgs e)
{
- if (AllBase.BaseClass.MainPath == "weixin")
+ if (AllBase.BaseClass.MainPath == "29wx")
{
this.ucCheckBox1.Visible = true;
}
diff --git a/TEMUKJD/MainForm.cs b/TEMUKJD/MainForm.cs
index 609cf04..8d2895a 100644
--- a/TEMUKJD/MainForm.cs
+++ b/TEMUKJD/MainForm.cs
@@ -57,7 +57,7 @@ namespace TemuKJD
public static int ProcessCount = 0;
public static MainForm instance;
- public string LoginType;
+ //public string LoginType;
private Point mouseOffset;//记录鼠标指针的坐标
private bool isMouseDown;//记录鼠标左键是否按下
public delegate void delegateShow(Form nf);
@@ -146,30 +146,26 @@ namespace TemuKJD
//SetFormRoundRectRgn(this, 7);
}
- public MainForm(string loginType = "Temu")
+ public MainForm()
{
InitializeComponent();
- LoginType = loginType;
- if (loginType == "Pdd")
- {
- BaseClass.MainPath = "binxixi";
+ if (BaseClass.MainPath == "29pdd")
+ {
GlobalConfig.MainColor = GlobalConfig.PddMainColor;
GlobalConfig.MainColorLight = GlobalConfig.PddMainColorLight;
GlobalConfig.BorderColor = GlobalConfig.PddBorderColor;
this.pnlJit.Visible = false;
}
- else if (loginType == "Wx")
+ else if (BaseClass.MainPath == "29wx")
{
- BaseClass.MainPath = "weixin";
GlobalConfig.MainColor = GlobalConfig.WeiXinMainColor;
GlobalConfig.MainColorLight = GlobalConfig.WeiXinMainColorLight;
GlobalConfig.BorderColor = GlobalConfig.WeiXinBorderColor;
this.pnlJit.Visible = false;
}
- else if (loginType == "Dy")
+ else if (BaseClass.MainPath == "29dy")
{
- BaseClass.MainPath = "douyin";
this.pnlJit.Visible = false;
}
@@ -230,7 +226,7 @@ namespace TemuKJD
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.LogoImage = Properties.Resources.pdd_logo;
@@ -240,7 +236,7 @@ namespace TemuKJD
BaseClass.ToolName = "29供应链 - 多多管理工具";
}
- if (BaseClass.MainPath == "weixin")
+ if (BaseClass.MainPath == "29wx")
{
BaseClass.Ico = Icon.FromHandle(Properties.Resources.weixin_icon.GetHicon());
BaseClass.LogoImage = Properties.Resources.weixin_logo;
@@ -862,7 +858,7 @@ namespace TemuKJD
}
ShowMainPanel(shopForm as ShopForm, sender as Panel);
}
- else if (BaseClass.MainPath == "binxixi")
+ else if (BaseClass.MainPath == "29pdd")
{
if (shopForm == null)
{
@@ -870,7 +866,7 @@ namespace TemuKJD
}
ShowMainPanel(shopForm as A_PddShopForm, sender as Panel);
}
- else if (BaseClass.MainPath == "weixin")
+ else if (BaseClass.MainPath == "29wx")
{
if (shopForm == null)
{
@@ -891,15 +887,7 @@ namespace TemuKJD
}
ShowMainPanel(adminForm as AdminForm, sender as Panel);
}
- else if (BaseClass.MainPath == "binxixi")
- {
- if (adminForm == null)
- {
- adminForm = new PDDAdminForm();
- }
- ShowMainPanel(adminForm as PDDAdminForm, sender as Panel);
- }
- else if (BaseClass.MainPath == "douyin")
+ else if (BaseClass.MainPath == "29dy")
{
//if (adminForm == null)
//{
@@ -907,7 +895,15 @@ namespace TemuKJD
//}
//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)
{
@@ -928,7 +924,7 @@ namespace TemuKJD
}
ShowMainPanel(uploadForm as ProductForm, sender as Panel);
}
- else if (BaseClass.MainPath == "binxixi")
+ else if (BaseClass.MainPath == "29pdd")
{
if (uploadForm == null)
{
@@ -936,7 +932,7 @@ namespace TemuKJD
}
ShowMainPanel(uploadForm as PDDProductForm, sender as Panel);
}
- else if (BaseClass.MainPath == "weixin")
+ else if (BaseClass.MainPath == "29wx")
{
if (uploadForm == null)
{
diff --git a/TEMUKJD/PDDForms/AdminForms/PDDAdminShopLoginForm.cs b/TEMUKJD/PDDForms/AdminForms/PDDAdminShopLoginForm.cs
index 10a13e0..970565a 100644
--- a/TEMUKJD/PDDForms/AdminForms/PDDAdminShopLoginForm.cs
+++ b/TEMUKJD/PDDForms/AdminForms/PDDAdminShopLoginForm.cs
@@ -501,7 +501,7 @@ namespace TemuKJD.PDDForms.AdminForms
//public Func
[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"))
{
try
@@ -193,7 +226,7 @@ namespace Update
try
{
WebClientUtils webClient = new WebClientUtils();
- webClient.Timeout = 600;
+ webClient.Timeout = 1200; // 20分钟
if (File.Exists(FilePath))
File.Delete(FilePath);
webClient.DownloadProgressChanged += WebClient_DownloadProgressChanged;
diff --git a/Work/Initialization.cs b/Work/Initialization.cs
index b8142c7..bce8efa 100644
--- a/Work/Initialization.cs
+++ b/Work/Initialization.cs
@@ -320,7 +320,7 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
// while (true)
{
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 html = GetHtml.PostUtf8(url, data);
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 updateExeAddress = BaseRegex.GetStringJson(ref html, "exe_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();
+
if (File.Exists(updatefilepath))
{
string fc = BaseClass.GetFileMd5(updatefilepath);
@@ -348,13 +350,13 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
{
if (File.Exists(updatefilepath))
{
- File.WriteAllText(System.Environment.CurrentDirectory + "\\UpdateConfig.ini",
- "TemuKJD\r\n" +
- BaseClass.VersionCount + "\r\n" +
- newVersion + "\r\n" +
- updateFileAddress);
+ string fileName = Path.GetFileName(Process.GetCurrentProcess().MainModule.FileName);
- 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)