Browse Source

更新超时时间

master
胡超1 1 year ago
parent
commit
3924cd5562
  1. 6
      CPF_Cef/Common/ChunkedUpload.cs
  2. 2
      CPF_Cef/FrmMain.cs
  3. 38
      CPF_Cef/MainModel.cs
  4. 6
      CPF_Cef/Parame.cs

6
CPF_Cef/Common/ChunkedUpload.cs

@ -148,6 +148,7 @@ namespace AksWebBrowser.Common
{ {
try try
{ {
timeout = timeout == 0 ? Parame.timeout : timeout; timeout = timeout == 0 ? Parame.timeout : timeout;
var client = new HttpClient(); var client = new HttpClient();
client.Timeout = TimeSpan.FromSeconds(timeout); client.Timeout = TimeSpan.FromSeconds(timeout);
@ -268,7 +269,7 @@ namespace AksWebBrowser.Common
/// 获取指纹 /// 获取指纹
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public async Task<string> PostFinger(string type, int typeCode,int timeout) public async Task<string> PostFinger(string type, int typeCode, int timeout)
{ {
try try
{ {
@ -370,7 +371,7 @@ namespace AksWebBrowser.Common
string base64 = jo4["face_data"].ToString(); string base64 = jo4["face_data"].ToString();
if (Parame.isTMZ) if (Parame.isTMZ)
{ {
var faceA =Utils.Base64ByImages(base64); var faceA = Utils.Base64ByImages(base64);
//开启人脸比对 //开启人脸比对
LhtCF lht = new LhtCF(); LhtCF lht = new LhtCF();
string stat = lht.LhtCFFace("", faceA); string stat = lht.LhtCFFace("", faceA);
@ -448,6 +449,5 @@ namespace AksWebBrowser.Common
} }
} }
} }
} }
} }

2
CPF_Cef/FrmMain.cs

@ -121,6 +121,8 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
Parame.isGPY = true; Parame.isGPY = true;
} }
//开启/关闭纠偏显示
MainModel.EnableDeskImage(1);
} }
public void Writelog(string str, string dirName = @"logs") public void Writelog(string str, string dirName = @"logs")

38
CPF_Cef/MainModel.cs

@ -3,6 +3,7 @@ using AksWebBrowser.Common;
using AksWebBrowser.Devices; using AksWebBrowser.Devices;
using AKSWebBrowser.Commen; using AKSWebBrowser.Commen;
using Fleck; using Fleck;
using LibVLCSharp.Shared;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
@ -588,13 +589,9 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
else else
{ {
Task.Run(() => { HttpPostResponseBySign("open", 1, param.code, param.timeout); }); Task.Run(() => {HttpPostResponseBySign("open", 1, param.code, param.timeout); });
@event3.WaitOne(); @event3.WaitOne();
string result = sginStr; string result = sginStr;
if (sginStr.Contains(""))
{
result = " {\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "在规定时间内未签字" + "\"}";
}
SubmitLogs(result, "OpenSign"); SubmitLogs(result, "OpenSign");
return result; return result;
} }
@ -684,7 +681,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
else else
{ {
Task.Run(() => { HttpPostResponseByFinger("open", 1, param.timeout); }); Task.Run(() => {HttpPostResponseByFinger("open", 1, param.timeout); });
event2.WaitOne(); event2.WaitOne();
string result = string.Empty; string result = string.Empty;
Log.Info("指纹数据" + fingerStr); Log.Info("指纹数据" + fingerStr);
@ -1209,6 +1206,35 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
} }
/// <summary>
/// 开启/关闭纠偏显示
/// </summary>
/// <returns></returns>
public static string EnableDeskImage(int idx)
{
//获取设备信息
string param = "/EnableDeskImage?enable=" + idx;
Task.Run(() => HttpResponse(param));
@event6.WaitOne();
if (string.IsNullOrEmpty(gpyStr))
{
return "";
}
else
{
JObject jo = (JObject)JsonConvert.DeserializeObject(gpyStr);
if (jo["returnCode"].ToString() == "2" || jo["returnCode"].ToString() == "0")
{
return "200";
}
else
{
// // Log.Info(jo["returnMsg"].ToString());
return "";
}
}
}
/// <summary> /// <summary>
/// 拍照 /// 拍照
/// </summary> /// </summary>

6
CPF_Cef/Parame.cs

@ -16,7 +16,7 @@ namespace AksWebBrowser
public static TcpClient tcpClient { get; set; } public static TcpClient tcpClient { get; set; }
public static VideoView videoV { get; set; } public static VideoView videoV { get; set; }
public static CusWebBrowser webBrowser { get; set; } public static CusWebBrowser webBrowser { get; set; }
public static List<Func> FuncObject { get; set; } public static List<Func> FuncObject { get; set; }
//接口地址 //接口地址
public static string apiUrl = "http://192.168.0.34:92"; public static string apiUrl = "http://192.168.0.34:92";
//授权key //授权key
@ -30,8 +30,8 @@ namespace AksWebBrowser
//高拍仪devIndex //高拍仪devIndex
public static string gpydevIndex = "0"; public static string gpydevIndex = "0";
//签字版、指纹、身份证 //签字版、指纹、身份证
public static string signUrl = "http://127.0.0.1:9399/device"; public static string signUrl = "http://192.168.0.234:9399/device";
public static int timeout= 60; public static int timeout = 3000;
//票据打印机 //票据打印机
public static string pritPj = "/dev/ttyS7"; public static string pritPj = "/dev/ttyS7";
//波特率 //波特率

Loading…
Cancel
Save