From 528c105b3aea0e6e00477365f16f57c1e3d7eb1c Mon Sep 17 00:00:00 2001
From: WJC <wjc@hdlchina.com.cn>
Date: 星期四, 24 十月 2019 15:31:28 +0800
Subject: [PATCH] 2019-10-24-3

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs |   76 +++++++++++++++++++++++++++++++++++++-
 1 files changed, 74 insertions(+), 2 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
index 989af37..080da65 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/UserCenterCommon.cs
@@ -1,4 +1,5 @@
-锘縰sing System;
+锘縰sing Shared.Common;
+using System;
 using System.Collections.Generic;
 
 namespace Shared.Phone.UserCenter
@@ -169,7 +170,7 @@
         /// <summary>
         /// 鎴块棿鍚嶇О
         /// </summary>
-        public List<string> listRoomName = new List<string>();
+        public string RoomName = string.Empty;
         /// <summary>
         /// 璁惧鐨勬墦寮�鐘舵��
         /// </summary>
@@ -985,4 +986,75 @@
     }
 
     #endregion
+
+    #region 鈻� 璐﹀彿璁剧疆绫籣_________________________
+
+    /// <summary>
+    /// 璐﹀彿璁剧疆淇℃伅
+    /// </summary>
+    public class AccountOption
+    {
+        /// <summary>
+        /// 鏄惁浣跨敤鎸囩汗楠岃瘉
+        /// </summary>
+        public bool FingerprintAuthentication = false;
+        /// <summary>
+        /// 瀵嗙爜楠岃瘉
+        /// </summary>
+        public string PswAuthentication = string.Empty;
+        /// <summary>
+        /// 鎵嬪娍楠岃瘉
+        /// </summary>
+        public string GestureAuthentication = string.Empty;
+        /// <summary>
+        /// 鏄惁浣跨敤杩滅▼寮�閿�
+        /// </summary>
+        public bool DoorUnLockByRemote = false;
+        /// <summary>
+        /// 淇濆瓨
+        /// </summary>
+        public void Save()
+        {
+            //鍔犲瘑瀵嗙爜
+            string hdlKey = "hD1(La3o";
+            string oldPswAuthentication = PswAuthentication;
+            PswAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldPswAuthentication);
+            
+            string oldGestureAuthentication = GestureAuthentication;
+            GestureAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldGestureAuthentication);
+
+            var data = Newtonsoft.Json.JsonConvert.SerializeObject(this);
+            var byteData = System.Text.Encoding.UTF8.GetBytes(data);
+            string fullName = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, DirNameResourse.AccountOptionFile);
+            //鍐欏叆鍐呭
+            Shared.IO.FileUtils.WriteFileByBytes(fullName, byteData);
+            //杩樺師鏄庣爜
+            PswAuthentication = oldPswAuthentication;
+            GestureAuthentication = oldGestureAuthentication;
+        }
+
+        /// <summary>
+        /// 鍔犺浇鏁版嵁
+        /// </summary>
+        /// <returns></returns>
+        public AccountOption Load()
+        {
+            string fileName = System.IO.Path.Combine(Shared.IO.FileUtils.RootPath, Common.Config.Instance.Guid, DirNameResourse.AccountOptionFile);
+            if (System.IO.File.Exists(fileName) == false)
+            {
+                return new AccountOption();
+            }
+            var varByte = Shared.IO.FileUtils.ReadFile(fileName);
+            string strValue = System.Text.Encoding.UTF8.GetString(varByte);
+            var info = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountOption>(strValue);
+            //瑙e瘑瀵嗙爜
+            string hdlKey = "hD1(La3o";
+            info.PswAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.PswAuthentication);
+            info.GestureAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.GestureAuthentication);
+
+            return info;
+        }
+    }
+
+    #endregion
 }

--
Gitblit v1.8.0