From f69ac4cd1e1ceeb7d9f88a6e28a9b5daa8c17fe6 Mon Sep 17 00:00:00 2001 From: dathlin Date: Sun, 17 Sep 2017 08:47:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=AB=AF=E7=9A=84?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E5=AD=98=E5=82=A8=E7=BB=86=E8=8A=82=E6=9B=B4?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CommonLibrary/BasicSupport/SoftSettings.cs | 33 ++++++++++++++++------ 软件系统服务端模版/FormServerWindow.cs | 1 + 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/CommonLibrary/BasicSupport/SoftSettings.cs b/CommonLibrary/BasicSupport/SoftSettings.cs index 336c9c2..52809da 100644 --- a/CommonLibrary/BasicSupport/SoftSettings.cs +++ b/CommonLibrary/BasicSupport/SoftSettings.cs @@ -134,10 +134,7 @@ namespace CommonLibrary #endregion - - - - + #region Override Method @@ -153,9 +150,9 @@ namespace CommonLibrary { nameof(Announcement), new JValue(Announcement) }, { nameof(Can_Account_Login), new JValue(Can_Account_Login) }, { nameof(Account_Forbidden_Reason), new JValue(Account_Forbidden_Reason) }, - { nameof(SystemFactories), new JValue((new JArray(SystemFactories)).ToString()) }, + { nameof(SystemFactories), new JArray(SystemFactories) }, { nameof(WhetherToEnableTrustedClientAuthentication),new JValue(WhetherToEnableTrustedClientAuthentication) }, - { nameof(TrustedClientList),new JValue((new JArray(TrustedClientList)).ToString()) } + { nameof(TrustedClientList),new JArray(TrustedClientList) }, }; return json.ToString(); } @@ -170,9 +167,20 @@ namespace CommonLibrary Announcement = SoftBasic.GetValueFromJsonObject(json, nameof(Announcement), Announcement); Can_Account_Login = SoftBasic.GetValueFromJsonObject(json, nameof(Can_Account_Login), Can_Account_Login); Account_Forbidden_Reason = SoftBasic.GetValueFromJsonObject(json, nameof(Account_Forbidden_Reason), Account_Forbidden_Reason); - SystemFactories = JArray.Parse(SoftBasic.GetValueFromJsonObject(json, nameof(SystemFactories), "[]")).ToObject>(); + + if (json[nameof(SystemFactories)] != null) + { + SystemFactories = json[nameof(SystemFactories)].ToObject>(); + } + WhetherToEnableTrustedClientAuthentication = SoftBasic.GetValueFromJsonObject(json, nameof(WhetherToEnableTrustedClientAuthentication), false); - TrustedClientList = JArray.Parse(SoftBasic.GetValueFromJsonObject(json, nameof(TrustedClientList), "[]")).ToObject>(); + + if (json[nameof(TrustedClientList)] != null) + { + TrustedClientList = json[nameof(TrustedClientList)].ToObject>(); + } + + ; } #endregion @@ -185,6 +193,8 @@ namespace CommonLibrary /// public class JsonSettings : SoftFileSaveBase { + #region Constructor + /// /// 实例化一个设置的对象 /// @@ -193,6 +203,9 @@ namespace CommonLibrary SystemInfo = SoftAuthorize.GetInfo(); } + #endregion + + #region 客户端本地保存的数据 /// @@ -212,7 +225,7 @@ namespace CommonLibrary /// public DateTime LoginTime { get; set; } = DateTime.Now; /// - /// 指示系统的主题色是否是深色 + /// 指示系统的主题色是否是深色,目前只适合于wpf /// public bool IsThemeDark { get; set; } = false; @@ -223,6 +236,8 @@ namespace CommonLibrary public string SystemInfo { get; private set; } + #endregion + #region Override Method diff --git a/软件系统服务端模版/FormServerWindow.cs b/软件系统服务端模版/FormServerWindow.cs index 4ffd126..240a910 100644 --- a/软件系统服务端模版/FormServerWindow.cs +++ b/软件系统服务端模版/FormServerWindow.cs @@ -632,6 +632,7 @@ namespace 软件系统服务端模版 try { UserServer.ServerSettings.SystemFactories = JArray.Parse(data).ToObject>(); + RuntimeLogHelper?.WriteInfo("上传了分厂信息:" + data); } catch (Exception ex) {