From fefffbc9451499013b7af2a15fac0ccc3b394364 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期一, 15 四月 2024 16:31:25 +0800
Subject: [PATCH] 去掉Siri先
---
HDL_ON/Common/ApiUtlis.cs | 70 ++++++++++++++++++++++++++++++++++-
1 files changed, 68 insertions(+), 2 deletions(-)
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index 094a6e3..09393f6 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -77,7 +77,7 @@
/// </summary>
public void DownloadData()
{
- if (MainPage.InternetStatus == 0 || MainPage.NoLoginMode)
+ if (MainPage.NoLoginMode)
{
DownloadDataComplete = true;
return;
@@ -92,6 +92,7 @@
var waitPage = new Loading();
MainPage.BaseView.AddChidren(waitPage);
waitPage.Start(Language.StringByID(StringId.PleaseWait));
+
string code = StateCode.SUCCESS;
@@ -99,6 +100,59 @@
var downloadDataThread = new System.Threading.Thread(() =>
{
+ try
+ {
+ //澧炲姞3绉掍簯鏈嶅姟鍣ㄨ繛鎺ユ娴嬶紝杩炰笉涓婃湇鍔″櫒鐨勬椂鍊欎笉鍒锋柊鏁版嵁
+ 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);
+ Console.WriteLine(DateTime.Now);
+ if (revertObj == null || revertObj.Code != StateCode.SUCCESS)
+ {
+ DownloadDataComplete = true;
+ try
+ {
+ var spatialInfoDataBytes = FileUtlis.Files.ReadFile("SpatialInfoData");
+ if (spatialInfoDataBytes != null)
+ {
+ var spatialInfoDataString = System.Text.Encoding.UTF8.GetString(spatialInfoDataBytes);
+ if (spatialInfoDataString != null && !string.IsNullOrEmpty(spatialInfoDataString))
+ {
+ var spatialInfoDataList = JsonConvert.DeserializeObject<List<SpatialInfo>>(spatialInfoDataString);
+ SpatialInfo.CurrentSpatial.UpdateSpatialList(spatialInfoDataList);
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"{this.GetType()}:鍔犺浇缂撳瓨鎴块棿鏁版嵁寮傚父:{ex.Message}");
+ }
+
+ try
+ {
+ var fileList = Common.FileUtlis.Files.ReadFiles();
+ foreach (var file in fileList)
+ {
+ FunctionList.List.IniFunctionList(file, true);
+ }
+ Room.CurrentSpatial.InitRoomListFunctions();
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"{this.GetType()}:鍔犺浇缂撳瓨璁惧鏁版嵁寮傚父:{ex.Message}");
+ }
+
+
+ return;
+ }
+ }
+ catch (Exception ex)
+ {
+ MainPage.Log($"Error锛氫笅杞芥暟鎹�1锛歿ex.Message}");
+ DownloadDataComplete = true;
+ return;
+ }
MainPage.Log($"杩涘叆璇诲彇浜戠鏁版嵁绾跨▼");
//===================鍒锋柊Token=======================
code = Ins.HttpRequest.RefreshToken();
@@ -191,13 +245,25 @@
if (roomResult.Code == StateCode.SUCCESS)
{
MainPage.Log($"璇诲彇鎴块棿淇℃伅鎴愬姛");
- var revData = Newtonsoft.Json.JsonConvert.DeserializeObject<SpatialApiPack>(roomResult.Data.ToString());
+ var revData = JsonConvert.DeserializeObject<SpatialApiPack>(roomResult.Data.ToString());
if (revData == null)
{
revData = new SpatialApiPack();
}
{
SpatialInfo.CurrentSpatial.UpdateSpatialList(revData.list);
+ new System.Threading.Thread(() =>
+ {
+ try
+ {
+ var ssd = System.Text.Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(revData.list));
+ FileUtlis.Files.WriteFileByBytes("SpatialInfoData", ssd);
+ }catch(Exception ex)
+ {
+ MainPage.Log($"{this.GetType()}:淇濆瓨鎴块棿淇℃伅寮傚父锛歿ex.Message}");
+ }
+ })
+ { IsBackground = true }.Start();
}
}
else
--
Gitblit v1.8.0