From 8ce0f9b1e568dd9125e74421cd02fbc29381c1f1 Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 29 七月 2020 12:53:33 +0800
Subject: [PATCH] 新版本

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
index fffeefb..e396d32 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs
@@ -244,6 +244,14 @@
             string fullDir = string.Empty;
             if (upPath == string.Empty)
             {
+                //灏嗘ā鏉挎暟鎹繚瀛樺埌鍒版寚瀹氱殑鏂囦欢澶逛腑
+                var templateName = TemplateData.TemplateCommonLogic.Current.GetNewTemplateFileName();
+                var templateFile = TemplateData.TemplateCommonLogic.Current.SaveTemplateDataToFile(templateName, "HomeTemplate");
+
+                //灏嗘ā鏉縝in鏂囦欢绉诲姩鍒板浠芥枃浠跺す涓�
+                try { System.IO.File.Move(templateFile, System.IO.Path.Combine(Config.Instance.FullPath, templateName)); }
+                catch (Exception ex) { HdlLogLogic.Current.WriteLog(ex, "绉诲姩妯℃澘澶辫触"); }
+
                 //鑾峰彇鏈湴鏂囦欢
                 listAllFile = HdlFileLogic.Current.GetRootPathListFile();
                 fullDir = Common.Config.Instance.FullPath;
@@ -265,6 +273,11 @@
 
             foreach (string fileName in listAllFile)
             {
+                //鍒ゆ柇鎸囧畾鏂囦欢鏄惁闇�瑕佷笂浼�(鏍圭洰褰曠殑鎵嶅垽鏂�)
+                if (upPath == string.Empty && this.IsNotUpLoadFile(fileName) == true)
+                {
+                    continue;
+                }
                 if (fileName.EndsWith(".png") == true
                     || fileName.EndsWith(".bin") == true)
                 {
@@ -302,11 +315,6 @@
                     Shared.Common.CommonPage.BackKeyCanClick = true;
                     UserCenterResourse.AccountOption.AppCanSignout = true;
                     return false;
-                }
-                //鍒ゆ柇鏄惁鏄簲璇ヤ笂浼犵殑鏂囦欢
-                if (IsNotUpLoadFile(file) == true && upPath == string.Empty)
-                {
-                    continue;
                 }
                 //鏁寸悊鏁版嵁
                 var datainfo = new FileInfoData();
@@ -784,8 +792,15 @@
             //鍏抽棴杩涘害鏉�
             ProgressFormBar.Current.Close();
 
+            //娓呯┖鍏ㄩ儴鎴块棿
+            HdlRoomLogic.Current.DeleteAllRoom();
+            //娓呯┖鏈湴鍏ㄩ儴鐨勫満鏅暟鎹�
+            HdlSceneLogic.Current.DeleteAllLocalScene();
             //濡傛灉璇诲彇鍒扮殑鏂囦欢瀹屽叏娌℃湁闂锛屽垯娓呯悊鏈湴鐨勬枃浠�
             HdlFileLogic.Current.DeleteAllLocationFile(false);
+
+            //娓呯悊鏈湴鐨勬ā鏉挎枃浠�
+            TemplateData.TemplateCommonLogic.Current.DeleteAllLocalFile();
 
             //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰
             HdlFileLogic.Current.MoveDirectoryFileToHomeDirectory(tempDirectory, true);
@@ -829,11 +844,14 @@
         /// </summary>
         /// <param name="file"></param>
         /// <returns></returns>
-        public bool IsNotUpLoadFile(string file)
+        private bool IsNotUpLoadFile(string file)
         {
-            if (file == "Config.json")
+            if (file.StartsWith("Device_") == true
+               || file.StartsWith("Gateway_") == true
+               || file.StartsWith("Room_") == true
+               || file.StartsWith("Scene_") == true)
             {
-                //涓嶈兘瑕嗙洊Config鏂囦欢
+                //璁惧,缃戝叧,鎴块棿,鍦烘櫙鏂囦欢涓嶉渶瑕佷笂浼�,瀹冨凡缁忎繚瀛樺湪bin妯℃澘鏂囦欢涓�
                 return true;
             }
             return false;

--
Gitblit v1.8.0