xm
2020-08-14 a45fe56aeeac8f28a9891b83362954067c8166dc
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -29,12 +29,12 @@
            var connectMode = GetHttpConnectMode(checkAuthority);
            //获取从接口那里取到的比特数据
            var byteData = GettByteResponsePack(RequestName, connectMode, obj);
            if (byteData == null && setAgain == true)
            if (byteData == null)
            {
                if (setAgain == false)
                {
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    ShowNotNetMsg(RequestName, listNotShowError);
                    return false;
                }
                byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -69,7 +69,7 @@
                if (setAgain == false)
                {
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    ShowNotNetMsg(RequestName, listNotShowError);
                    return "Error";
                }
                byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -107,7 +107,7 @@
                if (setAgain == false)
                {
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    ShowNotNetMsg(RequestName, listNotShowError);
                    return null;
                }
                byteData = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -151,7 +151,7 @@
                if (setAgain == false)
                {
                    //当前无法访问网络
                    ShowNotNetMsg(listNotShowError);
                    ShowNotNetMsg(RequestName, listNotShowError);
                    return null;
                }
                revertObj = ResetByteRequestHttps(RequestName, checkAuthority, obj);
@@ -206,7 +206,7 @@
                if (count == 3)
                {
                    //显示没有网络的Msg
                    ShowNotNetMsg(null);
                    ShowNotNetMsg(RequestName, null);
                    break;
                }
            }
@@ -328,13 +328,15 @@
        /// <summary>
        /// 显示没有网络的Msg
        /// </summary>
        private static void ShowNotNetMsg(List<string> listNotShowError)
        private static void ShowNotNetMsg(string RequestName, List<string> listNotShowError)
        {
            if (listNotShowError != null && listNotShowError.Contains("NotCheck") == true)
            {
                //不检测
                return;
            }
            //HdlLogLogic.Current.WriteLog(-1, "当前无网络连接:" + RequestName);
            HdlThreadLogic.Current.RunMain(() =>
            {
                // 当前无网络连接,请确认网络
@@ -498,13 +500,18 @@
        #endregion
        #region ■ 刷新本地缓存_______________________
        /// <summary>
        /// 刷新本地所有缓存
        /// 刷新本地所有缓存(目前此方法只提供给恢复备份数据使用)
        /// </summary>
        public static void RefreshAllMemory()
        {
            //刷新住宅对象
            RefreshHomeObject();
            //根据模板文件,恢复数据
            TemplateData.TemplateCommonLogic.Current.RecoverDataByTemplateBinFile();
            //强制生成设备和网关文件
            TemplateData.TemplateCommonLogic.Current.CreatDeviceAndGatewayFileFromMemoryByForce();
            //刷新本地网关文件
            HdlGatewayLogic.Current.ReFreshByLocal();
            //刷新本地设备
@@ -569,7 +576,7 @@
                    //关闭全部弹窗
                    ShowMsgControl.CloseAllMsgDialog();
                    //关闭所有打开了的界面
                    CloseAllOpenForm();
                    CloseAllOpenForm(null, false);
                    //显示登陆画面
                    var formLogin = new Login.AccountLoginForm();
@@ -610,7 +617,7 @@
                    //收起左菜单
                    CommonPage.Instance.CloseLeftMenu();
                    //关闭所有打开了的界面
                    CloseAllOpenForm();
                    CloseAllOpenForm(null, false);
                    //显示登陆画面
                    var formLogin = new Login.AccountLoginForm();
@@ -630,7 +637,8 @@
        /// 关闭所有打开了的界面
        /// </summary>
        /// <param name="tagetFrom">目标界面,如果指定了的话,则关闭目标界面上层的全部界面(它自身不关闭)</param>
        public static void CloseAllOpenForm(string tagetFrom = null)
        /// <param name="refreshMainPage">当关闭的界面达到主页时,是否刷新主页</param>
        public static void CloseAllOpenForm(string tagetFrom = null, bool refreshMainPage = true)
        {
            while (UserView.HomePage.Instance.ChildrenCount > 0)
            {
@@ -654,7 +662,10 @@
                else if (view is UserView.UserPage)
                {
                    //刷新主页
                    UserView.UserPage.Instance.ReFreshControl();
                    if (refreshMainPage == true)
                    {
                        UserView.UserPage.Instance.ReFreshControl();
                    }
                    return;
                }
                else
@@ -803,6 +814,16 @@
                    HdlGatewayLogic.Current.ResetComandToBindBackupGateway();
                    //读取隐匿配置
                    HdlBackupLogic.Current.LoadHideOption();
                    //调试:强制开启后台调试App功能
                    if (UserCenterResourse.HideOption.StartDebugApp == 1)
                    {
                        HdlThreadLogic.Current.RunMain(() =>
                        {
                            var form = new HideOption.HideOptionMainForm();
                            form.AddForm();
                        });
                        return false;
                    }
                }
                //关闭所有接收
@@ -846,6 +867,9 @@
                //刷新APP前一次选择的网关ID(可以反复调用,需要在网关初始化完了之后才能调用)
                HdlGatewayLogic.Current.RefreshAppOldSelectGatewayId();
                //加载模板缓存
                //TemplateData.TemplateCommonLogic.Current.LoadLocalTemplateMemoryData();
                //0:已经同步过,不需要同步,这个时候需要提示备份
                if (result == 0 && ShowPrompted == true)
@@ -912,6 +936,8 @@
            HdlRoomLogic.Current.RefreshAllRoomByLocation();
            //刷新左边刷新房间视图列表
            HdlRoomLogic.Current.RefreshRoomListView();
            //加载模板缓存
            //TemplateData.TemplateCommonLogic.Current.LoadLocalTemplateMemoryData();
        }
        /// <summary>