From 351bdda734832d821a9764b0cde8be5d83c4ec50 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 01 十二月 2022 09:56:25 +0800
Subject: [PATCH] 2022年12月01日09:56:23
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs | 282 ++++++++++++++++++++++++++-----------------------------
1 files changed, 133 insertions(+), 149 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs
old mode 100755
new mode 100644
index 368d3c0..4f2cad3
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs
@@ -1,149 +1,133 @@
-锘縰sing System;
-using System.Collections.Generic;
-using System.Text;
-
-namespace Shared.Phone.UserCenter
-{
- /// <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 bool SafetyShortcut = false;
- /// <summary>
- /// 瀵嗙爜鍓╀綑鍙緭鍏ユ鏁�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int PasswordInputCount = 3;
- /// <summary>
- /// 鎵嬪娍瀵嗙爜鍓╀綑鍙緭鍏ユ鏁�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int PasswordGestureInputCount = 5;
- /// <summary>
- /// 妫�娴婣PP鏄惁鑳藉閫�鍑�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public bool AppCanSignout = false;
- /// <summary>
- /// 鍓嶄竴娆$殑浣忓畢ID锛岃繖涓笢瑗挎槸缁橴serCenterLogic.InitUserCenterMenmoryAndThread()鐢ㄧ殑
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public string OldHomeStringId = string.Empty;
- /// <summary>
- /// 鍓嶄竴娆$殑鐧诲綍璐﹀彿锛岃繖涓笢瑗挎槸缁橴serCenterLogic.InitUserCenterMenmoryAndThread()鐢ㄧ殑
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public string OldAccountId = string.Empty;
- /// <summary>
- /// 鐢ㄦ埛鍥剧墖鐩綍璺緞
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public string UserPictruePath = string.Empty;
- /// <summary>
- /// 瀹夐槻鎶ヨ淇℃伅璁板綍涓�澶╁唴鏈�澶х殑鎶ヨ鏁�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int SafetyOnedayMaxAlarmMsgCount = 50;
- /// <summary>
- /// 瀹夐槻鎶ヨ淇℃伅璁板綍鏈�澶уぉ鏁�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int SafetyMaxAlarmMsgDay = 5;
- /// <summary>
- /// 闂ㄩ攣鎶ヨ淇℃伅璁板綍涓�澶╁唴鏈�澶х殑鎶ヨ鏁�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int DoorLockOnedayMaxAlarmMsgCount = 200;
- /// <summary>
- /// 闂ㄩ攣鎶ヨ淇℃伅璁板綍鏈�澶уぉ鏁�
- /// </summary>
- [Newtonsoft.Json.JsonIgnore]
- public int DoorLockMaxAlarmMsgDay = 5;
-
- #region 鈻� 涓�鑸柟娉昣__________________________
-
- /// <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();
- }
- try
- {
- 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;
- }
- catch (Exception ex)
- {
- HdlLogLogic.Current.WriteLog(ex);
- return new AccountOption();
- }
- }
-
- /// <summary>
- /// 閲嶇疆瀵嗙爜鍓╀綑娆℃暟
- /// </summary>
- public void ResetPasswordCount()
- {
- this.PasswordInputCount = 3;
- this.PasswordGestureInputCount = 5;
- }
-
- #endregion
- }
-}
+锘縰sing System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone.UserCenter
+{
+ /// <summary>
+ /// 璐﹀彿璁剧疆淇℃伅
+ /// </summary>
+ public class AccountOptionClass
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <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>
+ [Newtonsoft.Json.JsonIgnore]
+ public int PasswordInputCount = 3;
+ /// <summary>
+ /// 鎵嬪娍瀵嗙爜鍓╀綑鍙緭鍏ユ鏁�
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public int PasswordGestureInputCount = 5;
+ /// <summary>
+ /// 妫�娴婣PP鏄惁鑳藉閫�鍑�
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public bool AppCanSignout = false;
+ /// <summary>
+ /// 鍓嶄竴娆$殑浣忓畢ID锛岃繖涓笢瑗挎槸缁橴serCenterLogic.InitUserCenterMenmoryAndThread()鐢ㄧ殑
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public string OldHomeStringId = string.Empty;
+ /// <summary>
+ /// 鍓嶄竴娆$殑鐧诲綍璐﹀彿锛岃繖涓笢瑗挎槸缁橴serCenterLogic.InitUserCenterMenmoryAndThread()鐢ㄧ殑
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public string OldAccountId = string.Empty;
+ /// <summary>
+ /// 鐢ㄦ埛鍥剧墖鐩綍璺緞
+ /// </summary>
+ [Newtonsoft.Json.JsonIgnore]
+ public string UserPictruePath = string.Empty;
+
+ #endregion
+
+ #region 鈻� 涓�鑸柟娉昣__________________________
+
+ /// <summary>
+ /// 淇濆瓨
+ /// </summary>
+ public void Save()
+ {
+ try
+ {
+ //鍔犲瘑瀵嗙爜
+ string hdlKey = "hD1(La3o";
+ string oldPswAuthentication = PswAuthentication;
+ PswAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldPswAuthentication);
+
+ string oldGestureAuthentication = GestureAuthentication;
+ GestureAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldGestureAuthentication);
+
+ //鍐欏叆鍐呭
+ HdlFileLogic.Current.SaveFileContent(DirNameResourse.AccountOptionFile, this);
+ //杩樺師鏄庣爜
+ PswAuthentication = oldPswAuthentication;
+ GestureAuthentication = oldGestureAuthentication;
+ }
+ catch (Exception ex)
+ {
+ HdlLogLogic.Current.WriteLog(ex);
+ }
+ }
+
+ /// <summary>
+ /// 鍔犺浇鏁版嵁
+ /// </summary>
+ /// <returns></returns>
+ public AccountOptionClass Load()
+ {
+ string fileName = DirNameResourse.AccountOptionFile;
+ if (System.IO.File.Exists(fileName) == false)
+ {
+ return new AccountOptionClass();
+ }
+ try
+ {
+ var varByte = HdlFileLogic.Current.ReadFileByteContent(fileName);
+ string strValue = System.Text.Encoding.UTF8.GetString(varByte);
+ var info = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountOptionClass>(strValue);
+ //瑙e瘑瀵嗙爜
+ string hdlKey = "hD1(La3o";
+ info.PswAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.PswAuthentication);
+ info.GestureAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.GestureAuthentication);
+
+ return info;
+ }
+ catch (Exception ex)
+ {
+ HdlLogLogic.Current.WriteLog(ex);
+ return new AccountOptionClass();
+ }
+ }
+
+ /// <summary>
+ /// 閲嶇疆瀵嗙爜鍓╀綑娆℃暟
+ /// </summary>
+ public void ResetPasswordCount()
+ {
+ this.PasswordInputCount = 3;
+ this.PasswordGestureInputCount = 5;
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0