From d96459d01bd5d3d30324ddb8b3b3f6f4009c2dba Mon Sep 17 00:00:00 2001 From: SugarChes Date: Wed, 29 Jul 2026 01:48:13 +0800 Subject: [PATCH] feat(login): bridge restored login options --- .../Hosting/LegacyApplicationHost.cs | 68 +++++++++++++++++-- 1 file changed, 64 insertions(+), 4 deletions(-) diff --git a/插件库/Lskj.Main/Hosting/LegacyApplicationHost.cs b/插件库/Lskj.Main/Hosting/LegacyApplicationHost.cs index 82a9db0..ddffb59 100644 --- a/插件库/Lskj.Main/Hosting/LegacyApplicationHost.cs +++ b/插件库/Lskj.Main/Hosting/LegacyApplicationHost.cs @@ -64,6 +64,50 @@ namespace Lskj.Main.Hosting get { return !SystemInfo.Instance.DisableRememberPassword; } } + public bool AutoUpdate + { + get + { + return SystemInfo.Instance.AutomaticUpdates || + DBConfig.Instance.UpdateSet; + } + } + + public bool AutoUpdateEnabled + { + get { return !SystemInfo.Instance.AutomaticUpdates; } + } + + public bool SmartClient + { + get { return DBConfig.Instance.SmallClient; } + } + + public bool SmartClientEnabled + { + get { return !SystemInfo.Instance.HiddenIntelligentClient; } + } + + public bool SmartClientVisible + { + get { return !SystemInfo.Instance.HiddenIntelligentClient; } + } + + public bool Notice + { + get + { + return SystemInfo.Instance.AutoCheckedNotice || + SystemInfo.Instance.StartMessageBox || + DBConfig.Instance.NoticeClient; + } + } + + public bool NoticeEnabled + { + get { return !SystemInfo.Instance.StartMessageBox; } + } + public DataTable LoadLedgers() { _ledgerTable = MainImpl.GetLedgerList() ?? new DataTable("Ledgers"); @@ -195,7 +239,11 @@ namespace Lskj.Main.Hosting public string Login( string loginName, string password, - bool rememberPassword) + bool rememberPassword, + bool forceLogin, + bool autoUpdate, + bool smartClient, + bool notice) { ERPInfo.Instance.LoginResult = false; if (string.IsNullOrWhiteSpace(loginName)) @@ -252,7 +300,10 @@ namespace Lskj.Main.Hosting return ResourceKeys.MacAddressError + ",当前地址:" + ERPInfo.Instance.MacAddress; - int loginResult = MainImpl.Login(userId, password, false); + int loginResult = MainImpl.Login( + userId, + password, + forceLogin); if (loginResult != 0) return LoginError(loginResult); @@ -262,7 +313,10 @@ namespace Lskj.Main.Hosting loginAccount, loginName, password, - rememberPassword); + rememberPassword, + autoUpdate, + smartClient, + notice); ERPInfo.Instance.LoginResult = true; LogUtil.WriteDebug("", "登录软件", "进入操作", "系统登录"); return string.Empty; @@ -300,7 +354,10 @@ namespace Lskj.Main.Hosting string loginAccount, string enteredLoginName, string password, - bool rememberPassword) + bool rememberPassword, + bool autoUpdate, + bool smartClient, + bool notice) { if (!MainImpl.HasExistsColumn("p_employeetab", "MacAdress")) BaseImpl.ExecSqlValue("alter table p_employeetab add MacAdress varchar(100)"); @@ -349,6 +406,9 @@ namespace Lskj.Main.Hosting DBConfig.Instance.LoginName = enteredLoginName; DBConfig.Instance.NoticeUserID = userId; DBConfig.Instance.NoticeUserName = userName; + DBConfig.Instance.UpdateSet = autoUpdate; + DBConfig.Instance.SmallClient = smartClient; + DBConfig.Instance.NoticeClient = notice; DBConfig.Instance.DataBook = accountBook; DBConfig.Instance.WriteConfig();