diff --git a/插件库/Lskj.Main/Model/Manager.cs b/插件库/Lskj.Main/Model/Manager.cs index 84b0931..a862343 100644 --- a/插件库/Lskj.Main/Model/Manager.cs +++ b/插件库/Lskj.Main/Model/Manager.cs @@ -33,6 +33,7 @@ using System.Net; using System.Collections; using System.Web; using Lskj.Web.Core.Util; +using System.Text.RegularExpressions; namespace Lskj.Main.Model { @@ -111,16 +112,13 @@ namespace Lskj.Main.Model if (isStart) { // Delphi数据库连接检查 - if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0) - { - MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]"); - SplashForm.HideForm(); - RunConfigForm(); - return; - } - - - + //if (DelphiHelper.Delphi_Init(new StringBuilder(DBConfig.Instance.GetDelphiConnection(DBConfig.Instance.dephiConnection))) == 0) + //{ + // MessageUtil.Show(ResourceKeys.UnConnectServer + "[By Delphi]"); + // SplashForm.HideForm(); + // RunConfigForm(); + // return; + //} SplashForm.HideForm(); @@ -296,15 +294,17 @@ namespace Lskj.Main.Model { //WinHelper.WinExec(File.Exists(dllName) ? dllName : PubUtil.AbsolutelyLibPath + dllName, 1); // WinHelper.WinExec(dllName); - string[] dllNameSplit = dllName.Split(','); - if (dllNameSplit.Length > 1 && dllNameSplit[1].Equals("1"))//嵌入exe模块 + string[] dllNameSplit = Regex.Split(dllName, ":args="); + string[] pmsSplit = dllNameSplit.Length > 1 ? (dllNameSplit[1] + "").Split(',') : null; + if (dllNameSplit.Length > 1 && pmsSplit != null && pmsSplit.Length > 0)//嵌入exe模块 { + string[] pmsArgs = pmsSplit.Select(pms => ReplaceHelper.ReplaceUserInfo(pms)).ToArray(); string guid = Guid.NewGuid().ToString(); XtraTabPage tp = new XtraTabPage(); ProcessStartInfo processStartInfo = new ProcessStartInfo() { FileName = dllNameSplit[0], - Arguments = HandleHelper.CombineArgs(args), + Arguments = HandleHelper.CombineArgs(pmsArgs), UseShellExecute = false, RedirectStandardOutput = false, RedirectStandardError = false, @@ -1045,4 +1045,33 @@ namespace Lskj.Main.Model { DateTime dateTime = DateTime.Now.AddDays(1); DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - \ No newline at end of file + long timestamp = (dateTime.Ticks - epoch.Ticks) / TimeSpan.TicksPerSecond; + pms.Add("exp", timestamp); + } + return $"{urlParams[0]}?pms={HttpUtility.UrlEncode(hasEn ? Lskj.Web.Core.Util.safety.AESUtil.Encrypt(JSON.Encode(pms), enVal) : Lskj.Web.Core.Util.safety.AESUtil.MobileEncrypt(JSON.Encode(pms)))}&{qpLS.SJoin("&")}"; + } + return url; + } + + + /// + /// 退出主程序,进入登录界面 + /// + public static void ReLogin() + { + if (_frmMain != null) + { + if (ERPInfo.Instance.WatermarkForm != null) + { + ERPInfo.Instance.WatermarkForm.Close(); + ERPInfo.Instance.WatermarkForm.Dispose(); + } + _frmMain.Close(); + _frmMain.Dispose(); + _frmMain = null; + } + StartForm(); + } + + } +} \ No newline at end of file