gxc
2020-01-10 b9cb076fe6127160c96c35bf9c8cebcffe1d5ccd
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;