From d297fddadd429ffffbeb3f623f5ad860c33b3e5a Mon Sep 17 00:00:00 2001
From: 陈嘉乐 <cjl@hdlchina.com.cn>
Date: 星期四, 07 一月 2021 15:41:48 +0800
Subject: [PATCH] 20201-1-7-1
---
HDL_ON/Common/ApiUtlis.cs | 59 ++++++++++++++++++++++++++++++++++++++---------------------
1 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/HDL_ON/Common/ApiUtlis.cs b/HDL_ON/Common/ApiUtlis.cs
index d1aace8..24eac42 100644
--- a/HDL_ON/Common/ApiUtlis.cs
+++ b/HDL_ON/Common/ApiUtlis.cs
@@ -64,18 +64,21 @@
if (MainPage.InternetStatus == 0)
return;
//绾跨▼寮�濮嬫椂闂�
- var beginTime = DateTime.Now.AddSeconds(6);
+ var endTime = DateTime.Now.AddSeconds(6);
+
+ MainPage.Log($"寮�濮嬪悓姝ヤ簯绔暟鎹�");
DownloadDataComplete = false;
var waitPage = new Loading();
MainPage.BaseView.AddChidren(waitPage);
- waitPage.Start();
+ waitPage.Start(Language.StringByID(StringId.PleaseWait));
string code = StateCode.SUCCESS;
var downloadDataThread = new System.Threading.Thread(() =>
{
+ MainPage.Log($"杩涘叆璇诲彇浜戠鏁版嵁绾跨▼");
//===================鍒锋柊Token=======================
code = Ins.HttpRequest.RefreshToken();
if (code != StateCode.SUCCESS)
@@ -249,7 +252,8 @@
{
Application.RunOnMainThread(() =>
{
- beginTime = DateTime.MinValue;
+ MainPage.Log($"缁撴潫璇诲彇浜戠鏁版嵁绾跨▼");
+ endTime = DateTime.MinValue;
DownloadDataComplete = true;
waitPage.Hide();
waitPage.RemoveFromParent();
@@ -257,33 +261,46 @@
}
});
downloadDataThread.IsBackground = true;
+ downloadDataThread.Priority = System.Threading.ThreadPriority.Highest;
downloadDataThread.Start();
//缃戠粶鍗¢】锛岀粓姝笅杞界嚎绋�
new System.Threading.Thread(() =>
{
- while (beginTime < DateTime.Now)
+ try
{
- if (DownloadDataComplete)
+ while (endTime > DateTime.Now)
{
- break;
+ if (DownloadDataComplete)
+ {
+ break;
+ }
+ System.Threading.Thread.Sleep(100);
}
- System.Threading.Thread.Sleep(100);
- }
- if (!DownloadDataComplete)
- {
- downloadDataThread.Abort();
- }
- DownloadDataComplete = true;
- Application.RunOnMainThread(() =>
- {
- waitPage.Hide();
- waitPage.RemoveFromParent();
- });
- //鍒濆鍖栨暟鎹�
- //SpatialInfo.CurrentSpatial.Clear();
+ if (!DownloadDataComplete)
+ {
+ //downloadDataThread.Abort();
+ }
+ DownloadDataComplete = true;
+ Application.RunOnMainThread(() =>
+ {
+ waitPage.Hide();
+ waitPage.RemoveFromParent();
+ });
+ //鍒濆鍖栨暟鎹�
+ //SpatialInfo.CurrentSpatial.Clear();
-
+ }
+ catch { }
+ finally
+ {
+ #region 璇诲彇鏈湴鏁版嵁
+ //璇诲彇闊充箰淇℃伅
+ UI.Music.A31MusicModel.ReadMusicStates();
+ //鎼滅储缃戝叧
+ DriverLayer.Control.Ins.SearchLoaclGateway();
+ #endregion
+ }
})
{ IsBackground = true }.Start();
}
--
Gitblit v1.8.0