diff --git a/BBWY.Client/App.xaml.cs b/BBWY.Client/App.xaml.cs index efb3658e..bb9da2a8 100644 --- a/BBWY.Client/App.xaml.cs +++ b/BBWY.Client/App.xaml.cs @@ -6,6 +6,7 @@ using BBWY.Common.Models; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using System; +using System.Diagnostics; using System.IO; using System.IO.MemoryMappedFiles; using System.Linq; @@ -107,6 +108,28 @@ namespace BBWY.Client serviceCollection.AddTransient<_1688PreviewPurchaseViewModel>(); ServiceProvider = serviceCollection.BuildServiceProvider(); + + #region 启动本机WebSocket服务 + { + var wssExeList = Process.GetProcessesByName("BBWY.WebSocket.Server"); + if (wssExeList == null || wssExeList.Count() == 0) + { + try + { + ProcessStartInfo p = new ProcessStartInfo(); + p.CreateNoWindow = true; + p.FileName = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "BBWY.WebSocket.Server.exe"); + p.Verb = "runas"; + Process.Start(p); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "启动bbwy websocket服务"); + } + } + } + #endregion + base.OnStartup(e); } diff --git a/BBWY.Client/BBWY.Client.csproj b/BBWY.Client/BBWY.Client.csproj index 0ff430af..139cee55 100644 --- a/BBWY.Client/BBWY.Client.csproj +++ b/BBWY.Client/BBWY.Client.csproj @@ -29,7 +29,6 @@ - @@ -44,7 +43,7 @@ - + diff --git a/BBWY.Client/ViewModels/Order/OrderListVoewModel_DongDong.cs b/BBWY.Client/ViewModels/Order/OrderListVoewModel_DongDong.cs index 25fd87fa..77141cc1 100644 --- a/BBWY.Client/ViewModels/Order/OrderListVoewModel_DongDong.cs +++ b/BBWY.Client/ViewModels/Order/OrderListVoewModel_DongDong.cs @@ -59,10 +59,13 @@ namespace BBWY.Client.ViewModels var order = OrderList.FirstOrDefault(o => o.Id == orderId); if (order == null) - order = OrderList.FirstOrDefault(o => !string.IsNullOrEmpty(o.BuyerAccount) && o.BuyerAccount == buyerAccount); + order = OrderList.FirstOrDefault(o => !string.IsNullOrEmpty(o.BuyerAccount) + && o.BuyerAccount == buyerAccount + && order.Consignee != null + && !order.Consignee.IsDecode); if (order == null || order.Consignee == null || order.Consignee.IsDecode) - return; //已经解密过 + return; var response = orderService.DecodeConsignee(order.Id, phone); if (!response.Success)