From 1c4904d77f484c075080942d87785481b52b6fb2 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期一, 28 十月 2019 14:58:46 +0800
Subject: [PATCH] Revert "Merge branch 'dev-tzy' into DEV_GXC"

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

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
index 1a83c35..f7020c4 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 = Common.Config.Instance.FullPath;
+            string strroot = UserCenterResourse.LocalRootPath;
             var backPath = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupdeleteDirectory);
             foreach (var file in listData)
             {
@@ -183,7 +183,7 @@
             }
 
             //鍒犻櫎鏂囦欢
-            string strroot = Common.Config.Instance.FullPath;
+            string strroot = UserCenterResourse.LocalRootPath;
             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 = Common.Config.Instance.FullPath;
+            string strroot = UserCenterResourse.LocalRootPath;
             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 = Common.Config.Instance.FullPath;
+            string strroot = UserCenterResourse.LocalRootPath;
             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)
         {
-            //鏍圭洰褰�
-            string strroot = Common.Config.Instance.FullPath;
-            if (strroot == string.Empty)
+            if (UserCenterResourse.LocalRootPath == 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)
         {
-            //鏍圭洰褰�
-            string strroot = Common.Config.Instance.FullPath;
-            if (strroot == string.Empty)
+            if (UserCenterResourse.LocalRootPath == 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,15 +357,14 @@
             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;
             }
             //鑷姩澶囦唤鍙湁涓�涓�
@@ -391,11 +390,6 @@
 
             //鍚屾鏈嶅姟鍣ㄧ殑鍙栨秷浜嗙殑鍒嗕韩鍐呭
             await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
-
-            //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
-            var file2 = System.IO.File.Create(checkFile);
-            file2.Close();
-
             return 1;
         }
 
@@ -483,7 +477,7 @@
                 //鏆備笉鏀寔鎴愬憳
                 return;
             }
-            string strroot = Common.Config.Instance.FullPath;
+            string strroot = UserCenterResourse.LocalRootPath;
             var path = System.IO.Path.Combine(strroot, DirNameResourse.LocalMemoryDirectory, DirNameResourse.AutoBackupDirectory);
 
             List<string> listFile1 = GetFileFromDirectory(path);

--
Gitblit v1.8.0