From c2ae647150ecb8340dc0ad81270104a78e6b2d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=BD=87=E9=98=B3?= Date: Fri, 21 Jun 2024 09:37:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=95=B0=E6=8D=AE=E4=BA=A4?= =?UTF-8?q?=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CPF_Cef/AksVideoPlayer.cs | 1 - CPF_Cef/Common/ChunkedUpload.cs | 5 ++--- CPF_Cef/Common/WebSocketClientWithHeartbeat.cs | 9 +++++++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CPF_Cef/AksVideoPlayer.cs b/CPF_Cef/AksVideoPlayer.cs index 8aca6df..3574053 100644 --- a/CPF_Cef/AksVideoPlayer.cs +++ b/CPF_Cef/AksVideoPlayer.cs @@ -48,7 +48,6 @@ namespace AksWebBrowser protected override void OnInitialized() { base.OnInitialized(); - //@"http://192.168.0.34:92/CaseFile/card/2024-06-03/20240603120112952.mp4" vplayer.Play(new Uri(url));//播放 } diff --git a/CPF_Cef/Common/ChunkedUpload.cs b/CPF_Cef/Common/ChunkedUpload.cs index 45625f6..d6fe28b 100644 --- a/CPF_Cef/Common/ChunkedUpload.cs +++ b/CPF_Cef/Common/ChunkedUpload.cs @@ -138,7 +138,7 @@ namespace AksWebBrowser.Common { //关闭签字版 await PublicSign("close", 2, timeout); - Task.Delay(500).Wait(); + Task.Delay(200).Wait(); string body = await PublicSign(type, typeCode, timeout); if (!string.IsNullOrEmpty(body)) { @@ -160,10 +160,9 @@ namespace AksWebBrowser.Common } else if (jo2["code"].ToString() == "1") { - Task.Delay(500).Wait(); //关闭签字版 await PublicSign("close", 2, timeout); - Task.Delay(500).Wait(); + Task.Delay(200).Wait(); //打开签字版 body = await PublicSign(type, typeCode, timeout); if (!string.IsNullOrEmpty(body)) diff --git a/CPF_Cef/Common/WebSocketClientWithHeartbeat.cs b/CPF_Cef/Common/WebSocketClientWithHeartbeat.cs index 427a594..3bb5e60 100644 --- a/CPF_Cef/Common/WebSocketClientWithHeartbeat.cs +++ b/CPF_Cef/Common/WebSocketClientWithHeartbeat.cs @@ -28,7 +28,9 @@ namespace AksWebBrowser.Common { _serverUri = Parame.smWebsocket; _webSocket.ConnectAsync(new Uri(_serverUri), CancellationToken.None); - ReceiveMessages(); SendHeartbeats(); + Task.Delay(200).Wait(); + ReceiveMessages(); + SendHeartbeats(); } catch (Exception ex) { @@ -103,6 +105,8 @@ namespace AksWebBrowser.Common timer.Stop(); results = "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + "aks100101" + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "人证合一验证失败." + "\"}"; Parame.socket.Send(results); + // 断开连接 + _webSocket.Dispose(); } } @@ -110,7 +114,6 @@ namespace AksWebBrowser.Common } else if (functionName == "CF_FaceCompare") { - //停止活检 Send("{\"function\":\"CF_StopLiveDetect\"}", "CF_StopLiveDetect"); //关闭摄像头 @@ -127,6 +130,8 @@ namespace AksWebBrowser.Common } timer.Stop(); Parame.socket.Send(results); + // 断开连接 + _webSocket.Dispose(); } } }