diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj
index 3484139..82d9a8d 100644
--- a/AllBase/AllBase.csproj
+++ b/AllBase/AllBase.csproj
@@ -165,12 +165,6 @@
-
-
-
-
-
-
@@ -207,6 +201,7 @@
+
diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs
index 6768ab1..11cf140 100644
--- a/AllBase/BaseClass.cs
+++ b/AllBase/BaseClass.cs
@@ -27,7 +27,7 @@ namespace AllBase
///
/// 版本ID
///
- public static int VersionCount = 976;
+ public static int VersionCount = 979;
//public static int VersionCount = 613;
///
@@ -49,6 +49,10 @@ namespace AllBase
public static bool GroupMarket = false;
public static bool IsLoginSuccess = false;
///
+ /// 微店Api地址
+ ///
+ public static string VDianApi = "https://api.vdian.com/";
+ ///
/// IP地址和名称
///
public static string IPAddress = "";
diff --git a/AllBase/Helper/GlobalConfig.cs b/AllBase/Helper/GlobalConfig.cs
index 59746b3..69ed406 100644
--- a/AllBase/Helper/GlobalConfig.cs
+++ b/AllBase/Helper/GlobalConfig.cs
@@ -4,9 +4,11 @@ using AllBase.Model.Param.ShopManage;
using AllBase.Model.Param.TemuProductManage;
using AllBase.Model.Result;
using AllBase.Model.Result.WXResult;
+using LittleCow.Model.Param.WeiDianManage;
using NaiBa.Util;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -19,11 +21,10 @@ namespace AllBase.Helper
/// 店铺列表
///
public static ConcurrentList ShopLoginList { get; set; } = new ConcurrentList();
- public static ConcurrentList BuyerLoginList { get; set; } = new ConcurrentList();
///
- /// 微店店铺列表
+ /// 拼多多买手列表
///
- public static ConcurrentList WeiDianShopLoginList { get; set; } = new ConcurrentList();
+ public static ConcurrentList BuyerLoginList { get; set; } = new ConcurrentList();
public static ConcurrentList WxTokenList { get; set; } = new ConcurrentList();
public static ConcurrentList WxCatList { get; set; } = new ConcurrentList();
@@ -42,5 +43,36 @@ namespace AllBase.Helper
//public static string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36";
public static string UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
+
+
+ ///
+ /// 微店店铺列表
+ ///
+ public static ConcurrentList VDianShopLoginList { get; set; } = new ConcurrentList();
+ ///
+ /// 微店上货参数
+ ///
+ public static WeiDianSettingParam WeiDianUploadParam { get; set; }
+ }
+
+ public enum ShopPlatform
+ {
+ [Description("淘宝")]
+ TaoBao = 1,
+
+ [Description("拼多多")]
+ PinDuoDuo = 2,
+
+ [Description("爆单王")]
+ BaoDanWang = 3,
+
+ [Description("苏宁")]
+ SuNing = 4,
+
+ [Description("微店")]
+ WeiDian = 5,
+
+ [Description("阿里巴巴")]
+ Alibaba = 6,
}
}
diff --git a/AllBase/HelperXiaoNaimao/DebugHelper.cs b/AllBase/HelperXiaoNaimao/DebugHelper.cs
deleted file mode 100644
index 3249a33..0000000
--- a/AllBase/HelperXiaoNaimao/DebugHelper.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AllBase.Helper
-{
- public class DebugHelper
- {
- public static void WriteLine(string message, bool all = false)
- {
- Debug.WriteLine(message);
- if (all)
- {
- Console.WriteLine(message);
- }
- }
- }
-}
diff --git a/AllBase/HelperXiaoNaimao/FileHelper.cs b/AllBase/HelperXiaoNaimao/FileHelper.cs
deleted file mode 100644
index d7f1362..0000000
--- a/AllBase/HelperXiaoNaimao/FileHelper.cs
+++ /dev/null
@@ -1,283 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Diagnostics;
-using System.IO;
-using System.Linq;
-using System.Reflection;
-using System.Security.Cryptography;
-using System.Text;
-using System.Threading.Tasks;
-
-namespace AllBase.Helper
-{
- public class FileHelper
- {
- ///
- /// 删除文件夹及子文件内文件
- ///
- ///
- public static void DeleteFolder(string path)
- {
- try
- {
- if (Directory.Exists(path)) //如果存在这个文件夹删除之
- {
- foreach (string d in Directory.GetFileSystemEntries(path))
- {
- if (File.Exists(d))
- File.Delete(d); //直接删除其中的文件
- else
- DeleteFolder(d); //递归删除子文件夹
- }
- Directory.Delete(path, true); //删除已空文件夹
- }
- }
- catch (Exception ex)
- {
- LogHelper.WriteWithTime(ex);
- }
- }
-
- public static void DeleteFile(string filePath)
- {
- try
- {
- if (File.Exists(filePath))
- {
- File.Delete(filePath);
- }
- }
- catch (Exception ex)
- {
- LogHelper.WriteWithTime(ex);
- }
- }
-
- public static void CopyFolder(string sourceFolder, string destFolder)
- {
- CreateDirectory(destFolder);
- string[] files = Directory.GetFiles(sourceFolder);
- foreach (string file in files)
- {
- string name = Path.GetFileName(file);
- string dest = Path.Combine(destFolder, name);
- File.Copy(file, dest);
- }
- string[] folders = Directory.GetDirectories(sourceFolder);
- foreach (string folder in folders)
- {
- string name = Path.GetFileName(folder);
- string dest = Path.Combine(destFolder, name);
- CopyFolder(folder, dest);
- }
- }
-
- public static void MoveFolder(string sourceFolder, string destFolder)
- {
- CreateDirectory(destFolder);
- string[] files = Directory.GetFiles(sourceFolder);
- foreach (string file in files)
- {
- string name = Path.GetFileName(file);
- string dest = Path.Combine(destFolder, name);
- if (File.Exists(dest))
- {
- File.Delete(dest);
- }
- File.Move(file, dest);
- }
- string[] folders = Directory.GetDirectories(sourceFolder);
- foreach (string folder in folders)
- {
- string name = Path.GetFileName(folder);
- string dest = Path.Combine(destFolder, name);
- if (File.Exists(dest))
- {
- File.Delete(dest);
- }
- MoveFolder(folder, dest);
- }
- }
-
- public static string Execute(string command, int seconds)
- {
- string output = string.Empty; //输出字符串
- if (command != null && !command.Equals(string.Empty))
- {
- Process process = new Process();//创建进程对象
- ProcessStartInfo startInfo = new ProcessStartInfo();
- startInfo.FileName = "cmd.exe";//设定需要执行的命令
- startInfo.Arguments = "/C " + command;//“/C”表示执行完命令后马上退出
- startInfo.UseShellExecute = false;//不使用系统外壳程序启动
- startInfo.RedirectStandardInput = false;//不重定向输入
- startInfo.RedirectStandardOutput = true; //重定向输出
- startInfo.CreateNoWindow = true;//不创建窗口
- process.StartInfo = startInfo;
- try
- {
- if (process.Start())//开始进程
- {
- if (seconds == 0)
- {
- process.WaitForExit();//这里无限等待进程结束
- }
- else
- {
- process.WaitForExit(seconds); //等待进程结束,等待时间为指定的毫秒
- }
- output = process.StandardOutput.ReadToEnd();//读取进程的输出
- }
- }
- catch (Exception ex)
- {
- Console.WriteLine(ex.Message);//捕获异常,输出异常信息
- }
- finally
- {
- if (process != null)
- {
- process.Close();
- }
- }
- }
- return output;
- }
-
- public static void CreateDirectory(string dir)
- {
- if (Path.HasExtension(dir))
- {
- dir = Path.GetDirectoryName(dir);
- }
- if (!Directory.Exists(dir))
- {
- Directory.CreateDirectory(dir);
- }
- }
-
- public static string ReadAllText(string filePath, Encoding encoding = null)
- {
- if (encoding == null)
- {
- return File.ReadAllText(filePath, Encoding.UTF8);
- }
- else
- {
- return File.ReadAllText(filePath, encoding);
- }
- }
-
- public static void WriteAllText(string filePathOrName, string content, Encoding encoding = null)
- {
- string path = Path.Combine(GetApplicationDir(), filePathOrName);
- CreateDirectory(path);
- if (encoding == null)
- {
- File.WriteAllText(path, content, Encoding.UTF8);
- }
- else
- {
- File.WriteAllText(path, content, encoding);
- }
- }
-
- public static void AppendAllText(string filePathOrName, string content, Encoding encoding = null)
- {
- string path = Path.Combine(GetApplicationDir(), filePathOrName);
- CreateDirectory(path);
- List contentList = new List { content };
- if (encoding == null)
- {
- File.AppendAllLines(path, contentList, Encoding.UTF8);
- }
- else
- {
- File.AppendAllLines(path, contentList, encoding);
- }
- }
-
- #region 获取软件所在目录
- public static string GetApplicationDir()
- {
- return AppDomain.CurrentDomain.BaseDirectory;
- }
- #endregion
-
- public static string GetParentDir(string dir)
- {
- dir = dir.Trim(Path.DirectorySeparatorChar);
- int last = dir.LastIndexOf(Path.DirectorySeparatorChar);
- if (last > 0)
- {
- return dir.Substring(0, last);
- }
- return dir;
- }
-
- public static string GetResourceFileContent(Assembly assembly, string resourceName)
- {
- using (Stream stream = assembly.GetManifestResourceStream(resourceName))
- {
- using (StreamReader reader = new StreamReader(stream))
- {
- string result = reader.ReadToEnd();
- return result;
- }
- }
- }
-
- public static Stream GetResourceFileStream(Assembly assembly, string resourceName)
- {
- // 调用之后要释放 stream
- Stream stream = assembly.GetManifestResourceStream(assembly.GetCustomAttribute().Title + "." + resourceName);
- return stream;
- }
-
- public static void SaveStream(Stream stream, string destPath)
- {
- CreateDirectory(destPath);
- using (var fileStream = new FileStream(destPath, FileMode.Create, FileAccess.Write))
- {
- stream.CopyTo(fileStream);
- }
- }
-
- public static long GetDirectorySize(string folderPath)
- {
- DirectoryInfo di = new DirectoryInfo(folderPath);
- if (!di.Exists)
- {
- return 0;
- }
- return di.EnumerateFiles("*", SearchOption.AllDirectories).Sum(fi => fi.Length);
- }
-
- public static void OpenUrl(string url)
- {
- try
- {
- Process.Start(url);
- }
- catch (Exception ex)
- {
- LogHelper.WriteWithTime(ex);
- }
- }
-
- public static void OpenDirectory(string dir)
- {
- Process.Start("explorer.exe", dir);
- }
-
- public static string GetFileName(string dir)
- {
- string fileName = Path.GetFileName(dir);
- int questionMark = fileName.IndexOf("?");
- if (questionMark > 0)
- {
- fileName = fileName.Substring(0, questionMark);
- }
- return fileName;
- }
- }
-}
diff --git a/AllBase/HelperXiaoNaimao/HtmlHelper.cs b/AllBase/HelperXiaoNaimao/HtmlHelper.cs
deleted file mode 100644
index 47ba4e1..0000000
--- a/AllBase/HelperXiaoNaimao/HtmlHelper.cs
+++ /dev/null
@@ -1,214 +0,0 @@
-using NaiBa.Util.Extension;
-using System;
-using System.Collections.Generic;
-using System.Globalization;
-using System.Linq;
-using System.Net;
-using System.Text;
-using System.Text.RegularExpressions;
-using System.Threading.Tasks;
-
-namespace AllBase.Helper
-{
- public class HtmlHelper
- {
- public static string HtmlEncode(string html)
- {
- if (string.IsNullOrEmpty(html))
- {
- return string.Empty;
- }
- else
- {
- return HttpUtility.HtmlEncode(html);
- }
- }
-
- public static string HtmlDecode(string url)
- {
- if (string.IsNullOrEmpty(url))
- {
- return string.Empty;
- }
- else
- {
- return HttpUtility.HtmlDecode(url);
- }
- }
-
- ///
- /// Unicode解码
- ///
- ///
- ///
- public static string UnicodeDecode(string html)
- {
- html = WebUtility.HtmlDecode(html);
-
- Regex reUnicode = new Regex(@"\\u([0-9a-fA-F]{4})", RegexOptions.Compiled);
- return reUnicode.Replace(html, m =>
- {
- short c;
- if (short.TryParse(m.Groups[1].Value, NumberStyles.HexNumber, CultureInfo.InvariantCulture, out c))
- {
- return "" + (char)c;
- }
- return m.Value;
- });
- }
-
- #region Resove
- public static string Resove(string html, string prefix, string subfix)
- {
- int inl = html.IndexOf(prefix);
- if (inl == -1)
- {
- prefix = prefix.Replace("\"", "'");
- subfix = subfix.Replace("\"", "'");
- inl = html.IndexOf(prefix);
- }
- if (inl == -1)
- {
- return null;
- }
- inl += prefix.Length;
- if (!string.IsNullOrEmpty(subfix))
- {
- int inl2 = html.IndexOf(subfix, inl);
- if (inl2 == -1)
- {
- return null;
- }
- string result = html.Substring(inl, inl2 - inl);
- return result;
- }
- else
- {
- string result = html.Substring(inl);
- return result;
- }
- }
- #endregion
-
- #region ResoveReverse
- public static string ResoveReverse(string html, string subfix, string prefix)
- {
- int inl = html.IndexOf(subfix);
- if (inl == -1)
- {
- return null;
- }
- string subString = html.Substring(0, inl);
- int inl2 = subString.LastIndexOf(prefix);
- if (inl2 == -1)
- {
- return null;
- }
- string s = subString.Substring(inl2 + prefix.Length, subString.Length - inl2 - prefix.Length);
- return s;
- }
- #endregion
-
- #region ResoveList
- public static List ResoveList(string html, string prefix, string subfix)
- {
- List list = new List();
- int index = 0;
- do
- {
- index = html.IndexOf(prefix, index);
- if (index == -1)
- {
- break;
- }
- index += prefix.Length;
- int indexEnd = html.IndexOf(subfix, index);
- if (indexEnd > 0)
- {
- string content = html.Substring(index, indexEnd - index);
- list.Add(content);
- }
- index = indexEnd;
- }
- while (index > -1);
- return list;
- }
- #endregion
-
- #region ResoveListByAT
- public static List ResoveListByAT(string html)
- {
- List list = new List();
-
- int index = html.IndexOf('@');
- while (index > 0)
- {
- int indexx = html.LastIndexOf("'", index); //向前一个单引号
- int indexy = html.IndexOf("'", index + 1); //向后一个单引号
- string s78 = html.Substring(indexx, indexy - indexx);
- s78 = s78.Replace("'", "");
- list.Add(s78);
- index = html.IndexOf('@', indexy);
- }
- return list;
- }
- #endregion
-
- ///
- /// 清除HTML代码
- ///
- ///
- public static string ClearHtml(string html)
- {
- html = html.ParseToString();
- html = Regex.Replace(html, @"(|