From 081ea8d273048fd03756718ac6fb48a3c09218e9 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期二, 29 十月 2019 13:10:00 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs |   38 ++++++++++++++++++++++----------------
 1 files changed, 22 insertions(+), 16 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
index f7020c4..1a83c35 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
@@ -151,7 +151,7 @@
             }
 
             //鍒犻櫎鏂囦欢
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var backPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
             foreach (var file in listData)
             {
@@ -183,7 +183,7 @@
             }
 
             //鍒犻櫎鏂囦欢
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var backPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
             foreach (var file in listData)
             {
@@ -219,7 +219,7 @@
         /// <returns></returns>
         public static List<string> GetAutoBackupEditorFile()
         {
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
             return GetFileFromDirectory(path);
@@ -231,7 +231,7 @@
         /// <returns></returns>
         public static List<string> GetAutoBackupDeleteFile()
         {
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
 
             return GetFileFromDirectory(path);
@@ -269,12 +269,12 @@
         /// <param name="fileName">鏂囦欢鐨勫悕瀛�,涓嶅惈璺緞</param>
         public static void AddOrEditorFile(string fileName)
         {
-            if (UserCenterResourse.LocalRootPath == string.Empty)
+            //鏍圭洰褰�
+            string strroot = Common.Config.Instance.FullPath;
+            if (strroot == string.Empty)
             {
                 return;
             }
-            //鏍圭洰褰�
-            string strroot = UserCenterResourse.LocalRootPath;
             //鑷姩澶囦唤鐩綍
             string strBackPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
@@ -306,12 +306,12 @@
         /// <param name="fileName">鏂囦欢鐨勫悕瀛�,涓嶅惈璺緞</param>
         public static void DeleteFile(string fileName)
         {
-            if (UserCenterResourse.LocalRootPath == string.Empty)
+            //鏍圭洰褰�
+            string strroot = Common.Config.Instance.FullPath;
+            if (strroot == string.Empty)
             {
                 return;
             }
-            //鏍圭洰褰�
-            string strroot = UserCenterResourse.LocalRootPath;
             //鑷姩鍒犻櫎澶囦唤鐩綍
             string strBackPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
 
@@ -341,15 +341,15 @@
                 await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
                 return 0;
             }
-            //鍒涘缓涓�涓┖鏂囦欢
-            var file = System.IO.File.Create(checkFile);
-            file.Close();
 
             //鏆傛椂涓嶆敮鎸佹垚鍛�
             if (UserCenterResourse.UserInfo.AuthorityNo == 3)
             {
                 //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭
                 await HdlShardLogic.Current.SynchronizeDbSharedContent();
+                //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+                var file = System.IO.File.Create(checkFile);
+                file.Close();
                 return 1;
             }
 
@@ -357,14 +357,15 @@
             var data = await HdlBackupLogic.Current.GetBackupListNameFromDB(1);
             if (data == null)
             {
-                //寮傚父,鍒犻櫎妫�娴嬫枃浠�
-                System.IO.File.Delete(checkFile);
                 return -1;
             }
             if (data.Count == 0)
             {
                 //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭
                 await HdlShardLogic.Current.SynchronizeDbSharedContent();
+                //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+                var file = System.IO.File.Create(checkFile);
+                file.Close();
                 return 1;
             }
             //鑷姩澶囦唤鍙湁涓�涓�
@@ -390,6 +391,11 @@
 
             //鍚屾鏈嶅姟鍣ㄧ殑鍙栨秷浜嗙殑鍒嗕韩鍐呭
             await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
+
+            //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+            var file2 = System.IO.File.Create(checkFile);
+            file2.Close();
+
             return 1;
         }
 
@@ -477,7 +483,7 @@
                 //鏆備笉鏀寔鎴愬憳
                 return;
             }
-            string strroot = UserCenterResourse.LocalRootPath;
+            string strroot = Common.Config.Instance.FullPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
             List<string> listFile1 = GetFileFromDirectory(path);

--
Gitblit v1.8.0