wxr
2024-09-24 691dbe24f5724f153e07947c7b75bdfea5f0b6d5
HDL_ON/Common/ApiUtlis.cs
@@ -4,6 +4,7 @@
using System.Threading.Tasks;
using HDL_ON.DAL.Server;
using HDL_ON.Entity;
using HDL_ON.UI;
using HDL_ON.UI.UI2.FuntionControlView.Video;
using HDL_ON.UI.UI2.Intelligence.Automation;
using Newtonsoft.Json;
@@ -104,7 +105,7 @@
            string code = StateCode.SUCCESS;
            Inverter.Ins.H5Page = null;//重置光伏页面
            var downloadDataThread = new System.Threading.Thread(async() =>
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                try
                {
@@ -279,26 +280,6 @@
                    return;
                }
                MainPage.Log($"刷新个人信息成功");
                //int count = 0;
                //while (count < 10)
                //{
                //    if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull())
                //    {
                //        System.Threading.Thread.Sleep(200);
                //    }
                //    else
                //    {
                //        break;
                //    }
                //    count++;
                //}
                //if (DB_ResidenceData.Instance.CheckWhetherGatewayIdIsNull())
                //{
                //    return;
                //}
                //return;
                try
                {
@@ -746,6 +727,34 @@
                        catch (Exception ex){
                            MainPage.Log("Error", $"读取本地数据异常:{ex.StackTrace}");
                        }
                        try
                        {
                            HomePage.LoadEvent_CheckTokenValid();
                            if (IsValidToken && !UserInfo.Current.IsTipedInvalidToken)
                            {
                                UserInfo.Current.IsTipedInvalidToken = true;
                                UserInfo.Current.SaveUserInfo();
                                Application.RunOnMainThread(() =>
                                {
                                    try
                                    {
                                        new PublicAssmebly().TipOptionMsg(StringId.Tip, StringId.TokenInvalidTipMsg, StringId.OfflineControl, StringId.GoLogin, () =>
                                        {
                                            HDLCommon.Current.Logout();
                                        });
                                    }
                                    catch (Exception ex)
                                    {
                                        MainPage.Log("Error", $"提示登录凭证窗口加载异常:{ex.StackTrace}");
                                    }
                                });
                            }
                        }
                        catch (Exception ex)
                        {
                            MainPage.Log("Error", $"更新登录凭证方法调用异常:{ex.StackTrace}");
                        }
                    }
                }
            })
@@ -778,6 +787,8 @@
        {
            lock (FunctionList.List.securities)
            {
                try
                {
                var pack = Ins.HttpRequest.GetSecurityList();
                if (pack.Code == StateCode.SUCCESS)
                {
@@ -787,6 +798,10 @@
                    foreach (var function in packList)
                    {
                        sidList.Add(function.sid);
                        }
                        if (sidList.Count == 0)
                        {
                            return;
                    }
                    var infoListPack = Ins.httpRequest.GetSecurityInfo(sidList, new List<string>());
                    var infoList = JsonConvert.DeserializeObject<List<SecurityAlarm>>(infoListPack.Data.ToString());
@@ -813,6 +828,11 @@
                    MainPage.Log($"读取安防列表失败:Code:{pack.Code}; Msg:{pack.message}");
                }
            }
                catch (Exception ex)
                {
                    MainPage.Log("Error", $"读取安防列表失败:Code:{ex.StackTrace}");
                }
            }
        }
        /// <summary>