陈嘉乐
2020-07-10 48ba446936b51fffafa7c3600c0dadc6ac0e8c20
ZigbeeApp/Shared/Phone/ZigBee/Common/Config.cs
@@ -60,8 +60,13 @@
            {
                config = new Config { };
            }
        }
            if (config.PasswordEncrypt != string.Empty)
            {
                //解密
                config.Password = Phone.UserCenter.UserCenterLogic.DecryptPassword("hD1(La3o", config.PasswordEncrypt);
            }
        }
        /// <summary>
        /// 当前登录的帐号
        /// </summary>
@@ -69,7 +74,12 @@
        /// <summary>
        /// 当前帐号密码
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public string Password = string.Empty;
        /// <summary>
        /// 加密密码
        /// </summary>
        public string PasswordEncrypt = string.Empty;
        /// <summary>
        /// 短信登录返回的md5后的密码
        /// </summary>
@@ -90,7 +100,12 @@
        /// 远程连接的Mqtt的客户端ID
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public string ConnEmqClientId = string.Empty;
        public string ConnEmqClientId = string.Empty;
        /// <summary>
        /// 当前登录的账号是不是之前的账号
        /// </summary>
        [Newtonsoft.Json.JsonIgnore]
        public bool TheSameLoginAccount = false;
        [Newtonsoft.Json.JsonIgnore]
        /// <summary>
@@ -125,11 +140,6 @@
        /// </summary>
        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;
@@ -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();