删除不合适的仓库 优化订单和售后单读取

This commit is contained in:
wule committed 2026-07-03 22:05:18 +08:00
1 parent 6f7aa58ac1
commit 13b68fa64e
53 files changed
+14843 -820

No files matched your search

+39 -29
View File
@@ -22,12 +22,19 @@ namespace _29WxOrderWpf
public partial class App : Application
{
public static int ProcessCount = 0;
public static string[] args = new List<string>().ToArray();
public static string[] args { get; set; } = new List<string>().ToArray();
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
if (e.Args.Length > 0)
{
if (e.Args.Length != 2 && e.Args.Any(a => a.Contains("--browser-subprocess-path")))
{
//MessageBox.Show(string.Join(",", args));
Process.GetCurrentProcess().Kill();
return;
}
args = e.Args;
}
@@ -69,36 +76,39 @@ namespace _29WxOrderWpf
string str = GetExceptionMsg(ex, string.Empty);
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
//BaseMsgForm.ShowError(str, "系统错误");
BaseMsgWindow.ShowError(null, str, "系统错误");
BaseMsgWindow.ShowError(str, "系统错误");
}
#region 初始化cef
CefSharpSettings.WcfEnabled = false;
if (!args.Any(a => a.Contains("--browser-subprocess-path")))
{
CefSharpSettings.WcfEnabled = false;
CefSharp.Wpf.CefSettings settings = new CefSharp.Wpf.CefSettings();
settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
settings.CefCommandLineArgs.Add("disable-gpu", "1"); // 禁止显卡加速
settings.IgnoreCertificateErrors = true;
settings.Locale = "zh-CN";
settings.LogSeverity = LogSeverity.Disable;
CefSharp.Wpf.CefSettings settings = new CefSharp.Wpf.CefSettings();
settings.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36";
settings.CefCommandLineArgs.Add("disable-gpu", "1"); // 禁止显卡加速
settings.IgnoreCertificateErrors = true;
settings.Locale = "zh-CN";
settings.LogSeverity = LogSeverity.Disable;
var pName = Process.GetCurrentProcess().ProcessName;
ProcessCount = Process.GetProcesses().Count(p => p.ProcessName == pName);
//138版cef自己不会分缓存,会因占用导致报错,手动分缓存
settings.CachePath = Path.Combine(Environment.CurrentDirectory, "Cache\\Order" + ProcessCount);
//settings.CachePath = null; //禁止缓存
//settings.CefCommandLineArgs.Add("enable-javascript", "1");
//settings.CefCommandLineArgs.Add("disable-features", "NetworkService,NetworkServiceInProcess");
settings.CefCommandLineArgs.Add("--disable-web-security", "1");
//settings.CefCommandLineArgs.Add("--disable-request-handling-for-testing", "1");
var pName = Process.GetCurrentProcess().ProcessName;
ProcessCount = Process.GetProcesses().Count(p => p.ProcessName == pName);
//138版cef自己不会分缓存,会因占用导致报错,手动分缓存
settings.CachePath = Path.Combine(Environment.CurrentDirectory, "Cache\\Order" + ProcessCount);
//settings.CachePath = null; //禁止缓存
//settings.CefCommandLineArgs.Add("enable-javascript", "1");
//settings.CefCommandLineArgs.Add("disable-features", "NetworkService,NetworkServiceInProcess");
settings.CefCommandLineArgs.Add("--disable-web-security", "1");
//settings.CefCommandLineArgs.Add("--disable-request-handling-for-testing", "1");
#if DEBUG
settings.LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cef_log_order.txt");
// 设置日志级别为详细
settings.LogSeverity = LogSeverity.Verbose;
// 捕获JavaScript异常堆栈(最多32帧)
settings.UncaughtExceptionStackSize = 32;
#endif
Cef.Initialize(settings);
settings.LogFile = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "cef_log_order.txt");
// 设置日志级别为详细
settings.LogSeverity = LogSeverity.Verbose;
// 捕获JavaScript异常堆栈(最多32帧)
settings.UncaughtExceptionStackSize = 32;
#endif
Cef.Initialize(settings);
}
#endregion
}
@@ -106,21 +116,21 @@ namespace _29WxOrderWpf
//{
// string str = GetExceptionMsg(e.Exception, e.ToString());
// NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
// BaseMsgWindow.ShowError(null, str, "系统错误");
// BaseMsgWindow.ShowError(str, "系统错误");
//}
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
{
string str = GetExceptionMsg(e.Exception, e.ToString());
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
BaseMsgWindow.ShowError(null, str, "系统错误");
BaseMsgWindow.ShowError(str, "系统错误");
}
static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
{
string str = GetExceptionMsg(e.ExceptionObject as Exception, e.ToString());
NaiBa.Util.Helper.LogHelper.WriteWithTime("SystemError:" + str);
BaseMsgWindow.ShowError(null, str, "系统错误");
BaseMsgWindow.ShowError(str, "系统错误");
}
/// <summary>
@@ -146,7 +156,7 @@ namespace _29WxOrderWpf
}
sb.AppendLine("***************************************************************");
NaiBa.Util.Helper.LogHelper.WriteWithTime("Error:" + sb);
BaseMsgWindow.ShowError(null, sb.ToString(), "系统错误");
BaseMsgWindow.ShowError(sb.ToString(), "系统错误");
return sb.ToString();
}