From 2be70a32d2a8c517bd9868fb60913fcc843e66fe Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 五月 2020 11:21:32 +0800
Subject: [PATCH] 上传代码

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs |   43 +++++++++++++++++++++++++++++++++----------
 1 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
index e5d5c93..e4997c7 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -487,7 +487,7 @@
                     alert.Show();
 
                     //Log鍑哄姏
-                    HdlLogLogic.Current.WriteLog(ex, "鐣岄潰閲嶆柊婵�娲诲紓甯�");
+                    HdlLogLogic.Current.WriteLog(ex, "鐣岄潰閲嶆柊婵�娲诲紓甯� " + UserCenterResourse.NowActionFormID);
                 }
             }
         }
@@ -832,6 +832,8 @@
         /// <returns></returns>
         public async static Task<bool> InitUserCenterMenmoryAndThread(bool ShowPrompted = true)
         {
+            //璋冪敤杩欎釜鏂规硶,閮介渶瑕侀噸鏂板埛鏂颁富椤�
+            UserView.UserPage.Instance.RefreshForm = true;
             //濡傛灉鏄櫄鎷熶綇瀹�
             if (Config.Instance.Home.IsVirtually == true)
             {
@@ -869,7 +871,7 @@
                 UserCenterResourse.ResidenceOption = UserCenterResourse.ResidenceOption.Load();
 
                 //鍒濆鍖栫櫥闄嗚处鍙风殑淇℃伅
-                var hadNet = await InitUserAccoutInfo();
+                var hadNet = await InitUserAccoutInfo(true);
                 //濡傛灉鏈夌綉缁滅殑璇�
                 if (hadNet == true)
                 {
@@ -940,6 +942,7 @@
         /// </summary>
         private static void InitUserCenterMenmoryByVirtualHome()
         {
+            UserCenterResourse.AccountOption.OldHomeStringId = Common.Config.Instance.Home.Id;
             //娓呯┖鎵�鏈夋垚鍛樼紦瀛�
             ClearAllMemberMemory();
             //棰勫垱寤轰釜浜轰腑蹇冨叏閮ㄧ殑鏂囦欢澶�
@@ -975,6 +978,11 @@
             UserCenterResourse.ResidenceOption.HomeMainPageSwitchIndex = 1;
             //褰撳墠鍒嗙被,鍦烘櫙鍜屽姛鑳芥墍閫夋嫨鐨勫垎鏀� 0:鍦烘櫙 1:鍔熻兘 2:鑷姩鍖�
             UserCenterResourse.ResidenceOption.CategoryPageSwitchIndex = 0;
+
+            //鍒囨崲浣忓畢娓呴櫎涔嬪墠閫昏緫缂撳瓨鏁版嵁;
+            Common.Logic.LogicList.Clear();
+            Common.Logic.LockLogicList.Clear();
+            Common.Logic.SoneLogicList.Clear();
         }
 
         #endregion
@@ -984,14 +992,18 @@
         /// <summary>
         /// 鍒濆鍖栫櫥闄嗚处鍙风殑淇℃伅
         /// </summary>
+        /// <param name="reLoad">鏄惁浠庢柊浠庢湰鍦板姞杞�(閲嶆柊鍒濆鍖栫櫥闄嗚处鍙风殑淇℃伅,涓嶉渶瑕侀噸鏂板姞杞�)</param>
         /// <returns></returns>
-        private async static Task<bool> InitUserAccoutInfo()
+        private async static Task<bool> InitUserAccoutInfo(bool reLoad)
         {
             //鍒濆鍖栦釜浜轰俊鎭殑鏍囪瘑
             UserCenterResourse.UserInfo.InitUserInfoSuccess = false;
-            //鑾峰彇鏈湴璁板綍鐨勭敤鎴蜂俊鎭�
-            UserCenterResourse.UserInfo = GetUserInformationFromLocation();
-            UserCenterResourse.UserInfo.UserIconFile = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, "Admin.png");
+            if (reLoad == true)
+            {
+                //鑾峰彇鏈湴璁板綍鐨勭敤鎴蜂俊鎭�
+                UserCenterResourse.UserInfo = GetUserInformationFromLocation();
+                UserCenterResourse.UserInfo.UserIconFile = System.IO.Path.Combine(UserCenterResourse.AccountOption.UserPictruePath, "Admin.png");
+            }
 
             //鑾峰彇鐧诲綍璐﹀彿鐨勪俊鎭�
             var pra = new AccountInfoPra();
@@ -1114,7 +1126,7 @@
         private async static Task<bool> ReInitUserAccoutInfo()
         {
             //閲嶆柊鍒濆鍖栬处鍙蜂俊鎭�
-            var result = await InitUserAccoutInfo();
+            var result = await InitUserAccoutInfo(false);
             if (result == false)
             {
                 return result;
@@ -1461,10 +1473,21 @@
         /// <param name="obj">闇�瑕佸簭鍒楀寲鐨勪笢瑗�</param>
         public static void SaveFileContent(string fullName, object obj)
         {
-            var data = Newtonsoft.Json.JsonConvert.SerializeObject(obj);
-            var byteData = System.Text.Encoding.UTF8.GetBytes(data);
+            var data = JsonConvert.SerializeObject(obj);
+            var byteData = Encoding.UTF8.GetBytes(data);
             //鍐欏叆鍐呭
-            Shared.IO.FileUtils.WriteFileByBytes(fullName, byteData);
+            System.IO.FileStream fileStream = null;
+            try
+            {
+                fileStream = new System.IO.FileStream(fullName, System.IO.FileMode.Create, System.IO.FileAccess.Write);
+                fileStream.Write(byteData, 0, byteData.Length);
+                fileStream.Flush();
+            }
+            catch { }
+            finally
+            {
+                fileStream?.Close();
+            }
         }
 
         /// <summary>

--
Gitblit v1.8.0