From a4924de3136289d10cabbf2f61a228387d44ded7 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期四, 07 十一月 2019 13:48:36 +0800
Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlAutoBackupLogic.cs
index f7020c4..e92ecfe 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);
 
@@ -337,19 +337,19 @@
             //濡傛灉鏈湴宸茬粡鎷ユ湁浜嗚繖涓枃浠讹紝鍒欒鏄庝笉鏄柊鎵嬫満锛屼笉鍐嶈嚜鍔ㄨ繕鍘�
             if (System.IO.File.Exists(checkFile) == true)
             {
-                //鍚屾鏈嶅姟鍣ㄧ殑鍙栨秷浜嗙殑鍒嗕韩鍐呭
-                await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
+                //鍚屾鏈嶅姟鍣ㄧ殑鍒嗕韩鍐呭
+                await HdlShardLogic.Current.SynchronizeDbSharedContent();
                 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;
             }
             //鑷姩澶囦唤鍙湁涓�涓�
@@ -388,8 +389,10 @@
             //娌℃湁閿欒鐨勮瘽锛屽垯绉诲姩鍒板綋鍓嶄綇瀹呮枃浠跺す涓嬮潰
             Global.MoveDirectoryFileToHomeDirectory(tempDir, true);
 
-            //鍚屾鏈嶅姟鍣ㄧ殑鍙栨秷浜嗙殑鍒嗕韩鍐呭
-            await HdlShardLogic.Current.SynchronizeDeleteSharedContent();
+            //鍒涘缓涓�涓┖鏂囦欢(鏍囪瘑宸茬粡瀹屾垚鍚屾)
+            var file2 = System.IO.File.Create(checkFile);
+            file2.Close();
+
             return 1;
         }
 
@@ -477,7 +480,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