黄学彪
2019-10-12 c6b35c3138b944830b5336bf610f918154dd47c7
ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Logic/UserCenterLogic.cs
@@ -47,7 +47,7 @@
            }
            var revertObj = JsonConvert.DeserializeObject<ResponsePack>(Encoding.UTF8.GetString(byteData));
            //检测是否存在错误信息
            return CheckNotEorrorMsg(revertObj, RequestName, listNotShowError);
            return CheckNotEorrorMsg(revertObj, RequestName, listNotShowError, obj);
        }
        /// <summary>
@@ -114,7 +114,7 @@
            }
            var revertObj = JsonConvert.DeserializeObject<ResponsePack>(Encoding.UTF8.GetString(byteData));
            //检测错误
            bool notError = CheckNotEorrorMsg(revertObj, RequestName, listNotShowError);
            bool notError = CheckNotEorrorMsg(revertObj, RequestName, listNotShowError, obj);
            if (notError == false)
            {
                return null;
@@ -165,7 +165,7 @@
                    var data = JsonConvert.DeserializeObject<ResponsePack>(data2);
                    if (data != null && string.IsNullOrEmpty(data.StateCode) == false)
                    {
                        bool notError = CheckNotEorrorMsg(data, RequestName, listNotShowError);
                        bool notError = CheckNotEorrorMsg(data, RequestName, listNotShowError, obj);
                        if (notError == false)
                        {
                            return null;
@@ -256,7 +256,8 @@
        /// <param name="revertObj">从接口接收到的数据</param>
        /// <param name="RequestName">请求接口</param>
        /// <param name="listNotShowError">不需要显示错误的错误类别(接口返回的错误类别)</param>
        public static bool CheckNotEorrorMsg(ResponsePack revertObj, string RequestName, List<string> listNotShowError = null)
        /// <param name="pra">请求的参数</param>
        public static bool CheckNotEorrorMsg(ResponsePack revertObj, string RequestName, List<string> listNotShowError = null, object pra = null)
        {
            if (revertObj == null)
            {
@@ -284,14 +285,17 @@
                        //如果用户已经退出了登陆,则不处理
                        return;
                    }
                    string msg = IMessageCommon.Current.GetMsgByRequestName(RequestName, revertObj.StateCode);
                    var control = new ShowMsgControl(ShowMsgType.Tip, msg);
                    control.Show();
                    //无效登录Token
                    if (revertObj.StateCode == "NoLogin")
                    string msg = IMessageCommon.Current.GetMsgByRequestName(RequestName, revertObj.StateCode, pra);
                    if (msg != null)
                    {
                        UserCenterLogic.ReLoginAgain(Config.Instance.Account, false);
                        var control = new ShowMsgControl(ShowMsgType.Tip, msg);
                        control.Show();
                        //无效登录Token
                        if (revertObj.StateCode == "NoLogin")
                        {
                            UserCenterLogic.ReLoginAgain(Config.Instance.Account, false);
                        }
                    }
                });
@@ -395,33 +399,26 @@
                            UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index];
                            if (UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true)
                            {
                                var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID];
                                if (Myform != null)
                                try
                                {
                                    try
                                    var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID];
                                    //触发界面再次激活的事件
                                    int value = Myform.FormActionAgainEvent();
                                    if (value == 1)
                                    {
                                        //触发界面再次激活的事件
                                        int value = Myform.FormActionAgainEvent();
                                        if (value == 1)
                                        {
                                            //Log出力
                                            HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 被激活");
                                        }
                                    }
                                    catch (Exception ex)
                                    {
                                        //出现未知错误,数据丢失
                                        var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost));
                                        alert.Show();
                                        //Log出力
                                        string msg = ex.Message + "\r\n";
                                        msg += ex.TargetSite.ToString();
                                        HdlLogLogic.Current.WriteLog(-1, msg);
                                        HdlLogLogic.Current.WriteLog(1, Myform.FormID + " 被激活");
                                    }
                                }
                                //释放这个变量
                                Myform = null;
                                catch (Exception ex)
                                {
                                    //出现未知错误,数据丢失
                                    var alert = new ShowMsgControl(ShowMsgType.Error, Language.StringByID(R.MyInternationalizationString.uUnknownErrorAndDataLost));
                                    alert.Show();
                                    //Log出力
                                    HdlLogLogic.Current.WriteLog(ex);
                                }
                            }
                        }
                        else if (actionForm != null && actionForm is UserView.UserPage)
@@ -433,9 +430,9 @@
                                UserCenterResourse.NowActionFormID = UserCenterResourse.listActionFormId[index];
                                if (UserCenterResourse.DicActionForm.ContainsKey(UserCenterResourse.NowActionFormID) == true)
                                {
                                    var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID];
                                    try
                                    {
                                        var Myform = UserCenterResourse.DicActionForm[UserCenterResourse.NowActionFormID];
                                        //触发界面再次激活的事件
                                        int value = Myform.FormActionAgainEvent();
                                        if (value == 1)
@@ -451,12 +448,8 @@
                                        alert.Show();
                                        //Log出力
                                        string msg = ex.Message + "\r\n";
                                        msg += ex.TargetSite.ToString();
                                        HdlLogLogic.Current.WriteLog(-1, msg);
                                        HdlLogLogic.Current.WriteLog(ex);
                                    }
                                    //释放这个变量
                                    Myform = null;
                                }
                            }
                        }
@@ -636,7 +629,7 @@
                    //通知云端,已经退出登陆
                    var result = await CommonPage.Instance.RequestHttpsZigbeeBytesResultAsync("ZigbeeUsers/SignOut", null, "GET");
                }
                Application.RunOnMainThread(() =>
                HdlThreadLogic.Current.RunMain(() =>
                {
                    //关闭所有打开了的界面
                    CloseAllOpenForm();