From 9a4b76398009cf76c508d61f7e48fb6f5cb7ac2d Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期二, 21 七月 2020 09:46:53 +0800 Subject: [PATCH] 请合并最新多功能面板代码 --- ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs | 70 ++++++++++++++++++++-------------- 1 files changed, 41 insertions(+), 29 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs index 79c3b95..973d822 100755 --- a/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs +++ b/ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs @@ -6,8 +6,9 @@ [System.Serializable] public class Config { - static readonly string fileName = "Config.json"; - static Config config; + private const string fileName = "Config.json"; + + private static Config config = null; public static Config Instance { get @@ -28,11 +29,11 @@ /// <summary> /// 璐︽埛鐧诲綍鎴愬姛鏃剁殑鏃堕棿 /// </summary> - public DateTime LoginDateTime = DateTime.MinValue; + public DateTime LoginDateTime = DateTime.MinValue; /// <summary> - /// Gets a value indicating whether this <see cref="T:Shared.Common.Config"/> is login. + /// /// </summary> - /// <value><c>true</c> if is login; otherwise, <c>false</c>.</value> + [Newtonsoft.Json.JsonIgnore] public bool IsLogin { get @@ -40,16 +41,6 @@ return (DateTime.Now - LoginDateTime).Days < 7; } } - - /// <summary> - /// 璐︽埛鐧诲綍鎴愬姛鐨勮处鎴风被鍨� - /// </summary> - public int AccountType = 0; - /// <summary> - /// 璐︽埛鐧诲綍鎴愬姛鐨勪富ID - /// </summary> - public int MasterID = 0; - public static void ReFresh() { @@ -60,8 +51,18 @@ { config = new Config { }; } - } - + if (config.PasswordEncrypt != string.Empty) + { + //瑙e瘑 + config.Password = Phone.UserCenter.UserCenterLogic.DecryptPassword("hD1(La3o", config.PasswordEncrypt); + } + } + + /// <summary> + /// 璐︽埛鐧诲綍鎴愬姛鐨勮处鎴风被鍨�(姝ゅ彉閲忛粯璁や负0,骞朵笖涓嶈祴鍊�) + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public int AccountType = 0; /// <summary> /// 褰撳墠鐧诲綍鐨勫笎鍙� /// </summary> @@ -69,7 +70,12 @@ /// <summary> /// 褰撳墠甯愬彿瀵嗙爜 /// </summary> + [Newtonsoft.Json.JsonIgnore] public string Password = string.Empty; + /// <summary> + /// 鍔犲瘑瀵嗙爜 + /// </summary> + public string PasswordEncrypt = string.Empty; /// <summary> /// 鐭俊鐧诲綍杩斿洖鐨刴d5鍚庣殑瀵嗙爜 /// </summary> @@ -90,12 +96,17 @@ /// 杩滅▼杩炴帴鐨凪qtt鐨勫鎴风ID /// </summary> [Newtonsoft.Json.JsonIgnore] - public string ConnEmqClientId = string.Empty; - - [Newtonsoft.Json.JsonIgnore] + public string ConnEmqClientId = string.Empty; + /// <summary> + /// 褰撳墠鐧诲綍鐨勮处鍙锋槸涓嶆槸涔嬪墠鐨勮处鍙� + /// </summary> + [Newtonsoft.Json.JsonIgnore] + public bool TheSameLoginAccount = false; + /// <summary> /// 褰撳墠甯愬彿鐨凾oken /// </summary> + [Newtonsoft.Json.JsonIgnore] public string Token { get @@ -121,18 +132,17 @@ } /// <summary> - /// 鐧诲綍鏃禩oken + /// 鐧诲綍鏃禩oken(鐩墠杩欎笢瑗挎病鐢�) /// </summary> + [Newtonsoft.Json.JsonIgnore] public string LoginToken = string.Empty; - /// <summary> - /// 鐧诲綍杩囩殑甯愬彿淇℃伅 - /// </summary> - public List<string> AccountList = new List<string> { }; - - public List<string> HomeFilePathList = new List<string> { }; - public string HomeId = string.Empty; + + /// <summary> + /// 浣忓畢鏂囦欢鍒楄〃 + /// </summary> + public List<string> HomeFilePathList = new List<string>(); [Newtonsoft.Json.JsonIgnore] private House m_Home = null; @@ -149,7 +159,7 @@ { return m_Home; } - m_Home = House.GetHouseByHouseId(HomeId); + m_Home = Phone.UserCenter.HdlResidenceLogic.Current.GetHouseByHouseId(HomeId); if (m_Home == null) { m_Home = new House(); @@ -181,6 +191,8 @@ /// </summary> public void Save() { + //鍔犲瘑,涓嶈兘淇濆瓨鏄庣爜 + this.PasswordEncrypt = Phone.UserCenter.UserCenterLogic.EncryptPassword("hD1(La3o", this.Password); var bytes = System.Text.Encoding.UTF8.GetBytes(Newtonsoft.Json.JsonConvert.SerializeObject(this)); Shared.IO.FileUtils.WriteFileByBytes(fileName, bytes); ReFresh(); -- Gitblit v1.8.0