wxr
2024-05-20 efcffde735fa65ae34bae0bcc86313b74ed0e36c
HDL_ON/Common/ApiUtlis.cs
@@ -97,7 +97,7 @@
            string code = StateCode.SUCCESS;
            Inverter.Ins.H5Page = null;//重置光伏页面
            bool hadInternet = true;
            var downloadDataThread = new System.Threading.Thread(() =>
            {
                try
@@ -106,11 +106,12 @@
                    var dataList = new List<GlobalRegionListRes>();
                    var requestJson = HttpUtil.GetSignRequestJson(new GetRegionListObj() { regionMark = HttpUtil.RegionMark });
                    Console.WriteLine(DateTime.Now);
                    var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost,"",3);
                    var revertObj = HttpUtil.RequestHttpsPost(NewAPI.API_POST_GlobalRegionList, requestJson, HttpUtil.GlobalRequestHttpsHost, "", 3);
                    Console.WriteLine(DateTime.Now);
                    if (revertObj == null || revertObj.Code != StateCode.SUCCESS)
                    {
                        DownloadDataComplete = true;
                        hadInternet = false;
                        try
                        {
                            var spatialInfoDataBytes = FileUtlis.Files.ReadFile("SpatialInfoData");
@@ -146,6 +147,10 @@
                        return;
                    }
                    else
                    {
                        hadInternet = true;
                    }
                }
                catch (Exception ex)
                {
@@ -153,6 +158,20 @@
                    DownloadDataComplete = true;
                    return;
                }
                finally
                {
                    if (!hadInternet)
                    {
                        Application.RunOnMainThread(() =>
                        {
                            if (waitPage != null)
                            {
                                waitPage.Hide();
                                waitPage.RemoveFromParent();
                            }
                        });
                    }
                }
                MainPage.Log($"进入读取云端数据线程");
                //===================刷新Token=======================
                code = Ins.HttpRequest.RefreshToken();