From b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期五, 10 一月 2020 17:35:23 +0800 Subject: [PATCH] 2020.1.10 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs | 39 +++++++++++++++++++++++++++++++-------- 1 files changed, 31 insertions(+), 8 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs index cafdac5..8cbd451 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/HdlBackupLogic.cs @@ -420,12 +420,9 @@ nvc.Add("ManualBackupType", ManualBackupType.ToString()); nvc.Add("IsOtherAccountCtrl", Common.Config.Instance.isAdministrator.ToString()); - for (int i = 0; i < listPicFile.Count; i++) - { - string base64 = GetBase64Text(fullName); - nvc.Add("UploadSubFileLists[" + i + "].BackupFileName", fileName); - nvc.Add("UploadSubFileLists[" + i + "].BackupFileContent", base64); - } + string base64 = GetBase64Text(fullName); + nvc.Add("UploadSubFileLists[0].BackupFileName", fileName); + nvc.Add("UploadSubFileLists[0].BackupFileContent", base64); bool result = UpLoadBigBackupFileToDB("App/UploadHomeAppGatewaySubFiles", fullName, nvc); if (result == false) @@ -577,12 +574,26 @@ { try { - //鍒犻櫎鏈湴鍏ㄩ儴Log - Global.CreateEmptyDirectory(Path.Combine(DirNameResourse.LocalMemoryDirectory, DirNameResourse.LogDirectory), true); + var listAllFile = HdlAutoBackupLogic.GetFileFromDirectory(upPath); + if (listAllFile.Count > 10) + { + listAllFile.Sort(); + while (listAllFile.Count >= 10) + { + System.IO.File.Delete(listAllFile[0]); + listAllFile.RemoveAt(0); + } + } } catch { } } ProgressFormBar.Current.Close(); + + HdlThreadLogic.Current.RunMain(() => + { + var contr = new ShowMsgControl(ShowMsgType.Tip, "Log涓婁紶鎴愬姛"); + contr.Show(); + }); return result; } @@ -638,6 +649,12 @@ IMessageCommon.Current.IgnoreError = false; return false; } + if (listFile.Count == 0) + { + //鎭㈠ + IMessageCommon.Current.IgnoreError = false; + return true; + } //妫�娴� string checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.ShowOptionMenuFile + UserCenterResourse.UserInfo.Account); @@ -652,6 +669,12 @@ //鍑哄姏璇︾粏Log(Debug鐢�) UserCenterResourse.HideOption.DetailedLog = 1; } + checkKeys = UserCenterLogic.EncryptPassword(UserCenterResourse.FileEncryptKey, DirNameResourse.DeviceHistoryFile + UserCenterResourse.UserInfo.Account); + if (listFile.Contains(checkKeys) == true) + { + //鏄剧ず璁惧鍘嗗彶鐗堟湰(Debug鐢�) + UserCenterResourse.HideOption.DeviceHistory = 1; + } //鎭㈠ IMessageCommon.Current.IgnoreError = false; -- Gitblit v1.8.0