From 71f1df7772feec5cf83feefa851608adac18e005 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 06 十一月 2019 17:45:23 +0800
Subject: [PATCH] 2019.11.6
---
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