From 6bca8fcd37a48808a0b9c9342fc1be0adddfece6 Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期五, 08 五月 2020 17:46:44 +0800
Subject: [PATCH] 请合并最新代码,优化绑定信息
---
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs | 73 +++++++++++++++---------------------
1 files changed, 30 insertions(+), 43 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs
index 368d3c0..4ea33c1 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Common/AccountOption.cs
@@ -7,8 +7,10 @@
/// <summary>
/// 璐﹀彿璁剧疆淇℃伅
/// </summary>
- public class AccountOption
+ public class AccountOptionClass
{
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
/// <summary>
/// 鏄惁浣跨敤鎸囩汗楠岃瘉
/// </summary>
@@ -25,10 +27,6 @@
/// 鏄惁浣跨敤杩滅▼寮�閿�
/// </summary>
public bool DoorUnLockByRemote = false;
- /// <summary>
- /// 鏄惁浣跨敤瀹夐槻蹇嵎鏂瑰紡
- /// </summary>
- public bool SafetyShortcut = false;
/// <summary>
/// 瀵嗙爜鍓╀綑鍙緭鍏ユ鏁�
/// </summary>
@@ -59,26 +57,8 @@
/// </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;
+
+ #endregion
#region 鈻� 涓�鑸柟娉昣__________________________
@@ -87,40 +67,47 @@
/// </summary>
public void Save()
{
- //鍔犲瘑瀵嗙爜
- string hdlKey = "hD1(La3o";
- string oldPswAuthentication = PswAuthentication;
- PswAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldPswAuthentication);
+ try
+ {
+ //鍔犲瘑瀵嗙爜
+ string hdlKey = "hD1(La3o";
+ string oldPswAuthentication = PswAuthentication;
+ PswAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldPswAuthentication);
- string oldGestureAuthentication = GestureAuthentication;
- GestureAuthentication = UserCenterLogic.EncryptPassword(hdlKey, oldGestureAuthentication);
+ 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;
+ 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;
+ }
+ catch (Exception ex)
+ {
+ HdlLogLogic.Current.WriteLog(ex);
+ }
}
/// <summary>
/// 鍔犺浇鏁版嵁
/// </summary>
/// <returns></returns>
- public AccountOption Load()
+ public AccountOptionClass 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();
+ return new AccountOptionClass();
}
try
{
var varByte = Shared.IO.FileUtils.ReadFile(fileName);
string strValue = System.Text.Encoding.UTF8.GetString(varByte);
- var info = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountOption>(strValue);
+ var info = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountOptionClass>(strValue);
//瑙e瘑瀵嗙爜
string hdlKey = "hD1(La3o";
info.PswAuthentication = UserCenterLogic.DecryptPassword(hdlKey, info.PswAuthentication);
@@ -131,7 +118,7 @@
catch (Exception ex)
{
HdlLogLogic.Current.WriteLog(ex);
- return new AccountOption();
+ return new AccountOptionClass();
}
}
--
Gitblit v1.8.0