胡超1 1 year ago
parent
commit
e1bf52c744
  1. 12
      CPF_Cef/Common/ChunkedUpload.cs
  2. 12
      CPF_Cef/Common/Utils.cs
  3. 10
      CPF_Cef/Devices/IDCard.cs
  4. 134
      CPF_Cef/MainModel.cs

12
CPF_Cef/Common/ChunkedUpload.cs

@ -183,35 +183,35 @@ namespace AksWebBrowser.Common
//byte[] byteArray = File.ReadAllBytes(tempFile); //byte[] byteArray = File.ReadAllBytes(tempFile);
//string base64String = Convert.ToBase64String(byteArray); //string base64String = Convert.ToBase64String(byteArray);
return "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":200,\"status\":true,\"suffix\":\"png\",\"data\":\"" + sign_pic + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"success\",\"code\":200,\"status\":true,\"suffix\":\"png\",\"data\":\"" + sign_pic + "\"}";
} }
else else
{ {
//Log.Error("请求签字失败" + jo["message"].ToString()); //Log.Error("请求签字失败" + jo["message"].ToString());
return "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}";
} }
} }
else else
{ {
return "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"png\",\"data\":\"" + "关闭成功" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"png\",\"data\":\"" + "关闭成功" + "\"}";
} }
} }
else else
{ {
if (type == "open" && typeCode == 1) if (type == "open" && typeCode == 1)
{ {
return "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}";
} }
else else
{ {
return "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "关闭签字失败" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "关闭签字失败" + "\"}";
} }
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("签字异常:" + ex.Message); //Log.Error("签字异常:" + ex.Message);
return "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字异常" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字异常" + "\"}";
} }
} }

12
CPF_Cef/Common/Utils.cs

@ -82,5 +82,17 @@ namespace AksWebBrowser.Common
} }
return dirpath; return dirpath;
} }
/// <summary>
/// 获取时间戳:10位,到秒
/// </summary>
public static string GetTimestamp()
{
DateTime currentTime = DateTime.Now;
DateTime epochTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
TimeSpan timeSpan = currentTime.ToUniversalTime() - epochTime;
long timestamp = (long)timeSpan.TotalSeconds;
return timestamp.ToString();
}
} }
} }

10
CPF_Cef/Devices/IDCard.cs

@ -134,27 +134,27 @@ namespace AksWebBrowser.Devices
}; };
//关闭 //关闭
LibClass.ICReaderClose(icdev); LibClass.ICReaderClose(icdev);
return "{\"keycode\":\"" + code + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":" + JsonConvert.SerializeObject(OBJ) + "}"; return "{\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":" + JsonConvert.SerializeObject(OBJ) + "}";
} }
else else
{ {
//关闭 //关闭
LibClass.ICReaderClose(icdev); LibClass.ICReaderClose(icdev);
return "{\"keycode\":\"" + code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "身份证持有者非本人!" + "\"}"; return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "身份证持有者非本人!" + "\"}";
} }
} }
else else
{ {
//关闭 //关闭
LibClass.ICReaderClose(icdev); LibClass.ICReaderClose(icdev);
return "{\"keycode\":\"" + code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证失败" + "\"}"; return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证失败" + "\"}";
} }
} }
else else
{ {
//关闭 //关闭
LibClass.ICReaderClose(icdev); LibClass.ICReaderClose(icdev);
return "{\"keycode\":\"" + code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证失败3" + "\"}"; return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证失败3" + "\"}";
} }
} }
catch (Exception ex) catch (Exception ex)
@ -164,7 +164,7 @@ namespace AksWebBrowser.Devices
{ {
LibClass.ICReaderClose(icdev); LibClass.ICReaderClose(icdev);
} }
return "{\"keycode\":\"" + code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; return "{\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
} }
} }

134
CPF_Cef/MainModel.cs

@ -36,12 +36,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
Parame.socket = socket; Parame.socket = socket;
socket.OnOpen = () => socket.OnOpen = () =>
{ {
string result = "{\"keycode\":\"" + "" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"连接成功\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"连接成功\"}";
socket.Send(result); socket.Send(result);
}; };
socket.OnClose = () => socket.OnClose = () =>
{ {
string result = "{\"keycode\":\"" + "" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"连接关闭\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"连接关闭\"}";
socket.Send(result); socket.Send(result);
}; };
socket.OnMessage = message => socket.OnMessage = message =>
@ -140,21 +140,21 @@ namespace AKS.EnterpriseLibrary.WebBrowser
result = openKey(keycode); result = openKey(keycode);
break; break;
default: default:
result = "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}";
break; break;
} }
} }
else else
{ {
result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"参数解析错误\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"参数解析错误\"}";
} }
} }
catch { result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"参数解析错误\"}"; } catch { result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"参数解析错误\"}"; }
finally { } finally { }
} }
else else
{ {
result = "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"无效指令\"}";
} }
try try
{ {
@ -164,18 +164,18 @@ namespace AKS.EnterpriseLibrary.WebBrowser
//byte[] bytes = SerializeContent(result); //byte[] bytes = SerializeContent(result);
socket.Send(result); socket.Send(result);
} }
catch { result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"返回参数失败\"}"; } catch { result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"400\",\"status\":true,\"data\":\"返回参数失败\"}"; }
finally { } finally { }
} }
//监听心跳并且回复客户端“已ping作为关键字” //监听心跳并且回复客户端“已ping作为关键字”
else if (content == "ping") else if (content == "ping")
{ {
string result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"收到客户端心跳\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"收到客户端心跳\"}";
socket.Send(result); socket.Send(result);
} }
else else
{ {
string result = "{\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"收到客户端心跳\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "hert" + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"收到客户端心跳\"}";
socket.Send(result); socket.Send(result);
} }
}; };
@ -235,17 +235,17 @@ namespace AKS.EnterpriseLibrary.WebBrowser
string result = IdcardStr; string result = IdcardStr;
if (string.IsNullOrEmpty(IdcardStr)) if (string.IsNullOrEmpty(IdcardStr))
{ {
result = "{\"keycode\":\"" + code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证失败" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取身份证失败" + "\"}";
} }
else else
{ {
if (IdcardStr == "500") if (IdcardStr == "500")
{ {
result = "{\"keycode\":\"" + code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "身份证持有者非本人" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"data\":\"" + "身份证持有者非本人" + "\"}";
} }
else else
{ {
result = "{\"keycode\":\"" + code + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":" + IdcardStr + "}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":" + IdcardStr + "}";
} }
} }
SubmitLogs(result, "IDCardRead"); SubmitLogs(result, "IDCardRead");
@ -254,7 +254,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("读取身份证卡号异常: " + ex.Message + ""); //Log.Error("读取身份证卡号异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "IDCardRead"); SubmitLogs(result, "IDCardRead");
return result; return result;
} }
@ -282,7 +282,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
string ph = param.ph; string ph = param.ph;
string ddrs = param.ddrs; string ddrs = param.ddrs;
@ -292,7 +292,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
if (!isFuncisFuncObject("SendByPrint")) if (!isFuncisFuncObject("SendByPrint"))
{ {
//Utils.MessagesBox("打印排队票据设备未授权使用"); //Utils.MessagesBox("打印排队票据设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印排队票据设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印排队票据设备未授权使用" + "\"}";
} }
else else
{ {
@ -300,13 +300,13 @@ namespace AKS.EnterpriseLibrary.WebBrowser
var data = print.SendPrint(ph, ddrs, qrcode, ywmc); var data = print.SendPrint(ph, ddrs, qrcode, ywmc);
if (data == 0) if (data == 0)
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}";
SubmitLogs(result, "SendByPrint"); SubmitLogs(result, "SendByPrint");
return result; return result;
} }
else else
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + (data == 1 ? "打印失败" : (data == 2 ? "打印机未连接" : "打印机初始化失败")) + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + (data == 1 ? "打印失败" : (data == 2 ? "打印机未连接" : "打印机初始化失败")) + "\"}";
SubmitLogs(result, "SendByPrint"); SubmitLogs(result, "SendByPrint");
return result; return result;
} }
@ -315,7 +315,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("打印排队票据异常: " + ex.Message + ""); //Log.Error("打印排队票据异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "SendByPrint"); SubmitLogs(result, "SendByPrint");
return result; return result;
} }
@ -348,14 +348,14 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
string text = param.text; string text = param.text;
bool ispaye = param.ispaye; bool ispaye = param.ispaye;
if (!isFuncisFuncObject("payleText")) if (!isFuncisFuncObject("payleText"))
{ {
//Utils.MessagesBox("文字语音播报设备未授权使用"); //Utils.MessagesBox("文字语音播报设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "文字语音播报设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "文字语音播报设备未授权使用" + "\"}";
} }
else else
{ {
@ -383,7 +383,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
// AutoAudio(false, ""); // AutoAudio(false, "");
}); });
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "停止播放成功" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "停止播放成功" + "\"}";
SubmitLogs(result, "payleText"); SubmitLogs(result, "payleText");
return result; return result;
} }
@ -394,13 +394,13 @@ namespace AKS.EnterpriseLibrary.WebBrowser
string result = string.Empty; string result = string.Empty;
if (string.IsNullOrEmpty(ttsStr)) if (string.IsNullOrEmpty(ttsStr))
{ {
result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "播放失败" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "播放失败" + "\"}";
SubmitLogs(result, "payleText"); SubmitLogs(result, "payleText");
} }
else else
{ {
Task.Run(() => { string command = $"sox {ttsStr} -d"; ShllCommad(command); }); Task.Run(() => { string command = $"sox {ttsStr} -d"; ShllCommad(command); });
result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "开始播放" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "开始播放" + "\"}";
} }
SubmitLogs(result, "payleText"); SubmitLogs(result, "payleText");
return result; return result;
@ -410,7 +410,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("文字语音播报异常2: " + ex.Message + ""); //Log.Error("文字语音播报异常2: " + ex.Message + "");
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "payleText"); SubmitLogs(result, "payleText");
return result; return result;
} }
@ -434,7 +434,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
//关闭 //关闭
//StopSn("0"); //StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -442,7 +442,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
//关闭 //关闭
//StopSn("0"); //StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -453,7 +453,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
string param = OpenSn("0"); string param = OpenSn("0");
if (string.IsNullOrEmpty(param)) if (string.IsNullOrEmpty(param))
{ {
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "扫描仪打开失败" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "扫描仪打开失败" + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -467,7 +467,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
//关闭 //关闭
//StopSn("0"); //StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"jpg\",\"data\":\"" + "获取图片失败" + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -475,7 +475,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
//关闭 //关闭
//StopSn("0"); //StopSn("0");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + param + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -488,7 +488,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("打开高拍仪并且进行快速扫描文件异常: " + ex.Message + ""); //Log.Error("打开高拍仪并且进行快速扫描文件异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -509,12 +509,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
if (!isFuncisFuncObject("OpenSign")) if (!isFuncisFuncObject("OpenSign"))
{ {
//Utils.MessagesBox("签字版设备未授权使用"); //Utils.MessagesBox("签字版设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}";
} }
else else
{ {
@ -528,7 +528,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("打开签字版异常: " + ex.Message + ""); //Log.Error("打开签字版异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "OpenSign"); SubmitLogs(result, "OpenSign");
return result; return result;
} }
@ -546,12 +546,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
if (!isFuncisFuncObject("OpenSign")) if (!isFuncisFuncObject("OpenSign"))
{ {
//Utils.MessagesBox("签字版设备未授权使用"); //Utils.MessagesBox("签字版设备未授权使用");
return "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "签字版设备未授权使用" + "\"}";
} }
else else
{ {
Task.Run(() => HttpPostResponseBySign("close", 2, "")); Task.Run(() => HttpPostResponseBySign("close", 2, ""));
string result = "{\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + "签字版已关闭" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + "签字版已关闭" + "\"}";
SubmitLogs(result, "openCamera"); SubmitLogs(result, "openCamera");
return result; return result;
} }
@ -559,7 +559,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("关闭签字版异常: " + ex.Message + ""); //Log.Error("关闭签字版异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "OpenSign"); SubmitLogs(result, "OpenSign");
return result; return result;
} }
@ -581,12 +581,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
if (!isFuncisFuncObject("ReadFingerData")) if (!isFuncisFuncObject("ReadFingerData"))
{ {
//Utils.MessagesBox("指纹设备未授权使用"); //Utils.MessagesBox("指纹设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "指纹设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "指纹设备未授权使用" + "\"}";
} }
else else
{ {
@ -597,12 +597,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
string result = string.Empty; string result = string.Empty;
if (string.IsNullOrEmpty(fingerStr)) if (string.IsNullOrEmpty(fingerStr))
{ {
result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "关闭失败" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "关闭失败" + "\"}";
SubmitLogs(result, "ReadFingerData"); SubmitLogs(result, "ReadFingerData");
} }
else else
{ {
result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "关闭成功" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "关闭成功" + "\"}";
} }
SubmitLogs(result, "ReadFingerData"); SubmitLogs(result, "ReadFingerData");
return result; return result;
@ -615,12 +615,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
Log.Info("指纹数据" + fingerStr); Log.Info("指纹数据" + fingerStr);
if (string.IsNullOrEmpty(fingerStr)) if (string.IsNullOrEmpty(fingerStr))
{ {
result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取失败" + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "读取失败" + "\"}";
SubmitLogs(result, "ReadFingerData"); SubmitLogs(result, "ReadFingerData");
} }
else else
{ {
result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + fingerStr + "\"}"; result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"jpg\",\"data\":\"" + fingerStr + "\"}";
} }
SubmitLogs(result, "ReadFingerData"); SubmitLogs(result, "ReadFingerData");
return result; return result;
@ -630,7 +630,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("指纹异常: " + ex.Message + ""); //Log.Error("指纹异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "ReadFingerData"); SubmitLogs(result, "ReadFingerData");
return result; return result;
} }
@ -657,14 +657,14 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
bool isopen = param.isopen; bool isopen = param.isopen;
string url = param.url; string url = param.url;
if (!isFuncisFuncObject("SoundRecording")) if (!isFuncisFuncObject("SoundRecording"))
{ {
Utils.MessagesBox("录音设备未授权使用"); Utils.MessagesBox("录音设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "录音设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "录音设备未授权使用" + "\"}";
} }
else else
{ {
@ -682,13 +682,13 @@ namespace AKS.EnterpriseLibrary.WebBrowser
MatchCollection mc = re.Matches(url);//获取的是一个数组 MatchCollection mc = re.Matches(url);//获取的是一个数组
string reurl = mc[0].ToString() + "://" + mc[1].ToString() + urlpath; string reurl = mc[0].ToString() + "://" + mc[1].ToString() + urlpath;
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"wav\",\"data\":\"" + reurl + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"wav\",\"data\":\"" + reurl + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
else else
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"suffix\":\"wav\",\"data\":\"" + "结束录音失败" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"suffix\":\"wav\",\"data\":\"" + "结束录音失败" + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
@ -697,13 +697,13 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (StartRecording()) if (StartRecording())
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"wav\",\"data\":\"" + "开始录音" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"wav\",\"data\":\"" + "开始录音" + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
else else
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"suffix\":\"wav\",\"data\":\"" + "录音失败" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"fali\",\"code\":\"400\",\"status\":false,\"suffix\":\"wav\",\"data\":\"" + "录音失败" + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
@ -713,14 +713,14 @@ namespace AKS.EnterpriseLibrary.WebBrowser
if (StopRecording()) if (StopRecording())
{ {
srpath = string.Empty; srpath = string.Empty;
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"wav\",\"data\":\"" + "取消录音" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"wav\",\"data\":\"" + "取消录音" + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
else else
{ {
srpath = string.Empty; srpath = string.Empty;
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"wav\",\"data\":\"" + "取消录音失败" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"wav\",\"data\":\"" + "取消录音失败" + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
@ -731,7 +731,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("开始录音、取消录音、结束录音异常: " + ex.Message + ""); //Log.Error("开始录音、取消录音、结束录音异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "SoundRecording"); SubmitLogs(result, "SoundRecording");
return result; return result;
} }
@ -754,14 +754,14 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
string url = param.url; string url = param.url;
string ext = param.ext; string ext = param.ext;
if (!isFuncisFuncObject("PrintFile")) if (!isFuncisFuncObject("PrintFile"))
{ {
//Utils.MessagesBox("打印机设备未授权使用"); //Utils.MessagesBox("打印机设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印机设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印机设备未授权使用" + "\"}";
} }
else else
{ {
@ -791,7 +791,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
string command = $"lp -d {PrinterName} {path}"; string command = $"lp -d {PrinterName} {path}";
ShllCommad(command); ShllCommad(command);
}); });
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}";
SubmitLogs(result, "PrintFile"); SubmitLogs(result, "PrintFile");
return result; return result;
} }
@ -799,7 +799,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("根据文件地址在线打印异常: " + ex.Message + ""); //Log.Error("根据文件地址在线打印异常: " + ex.Message + "");
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "PrintFile"); SubmitLogs(result, "PrintFile");
return result; return result;
} }
@ -825,12 +825,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
if (!isFuncisFuncObject("PrintBase64")) if (!isFuncisFuncObject("PrintBase64"))
{ {
//Utils.MessagesBox("打印机设备未授权使用"); //Utils.MessagesBox("打印机设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印机设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "打印机设备未授权使用" + "\"}";
} }
else else
{ {
@ -855,14 +855,14 @@ namespace AKS.EnterpriseLibrary.WebBrowser
string command = $"lp -d {PrinterName} {path}"; string command = $"lp -d {PrinterName} {path}";
ShllCommad(command); ShllCommad(command);
}); });
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "打印成功" + "\"}";
SubmitLogs(result, "PrintBase64"); SubmitLogs(result, "PrintBase64");
return result; return result;
} }
} }
catch (Exception ex) catch (Exception ex)
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "PrintBase64"); SubmitLogs(result, "PrintBase64");
return result; return result;
} }
@ -886,14 +886,14 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
if (param == null) if (param == null)
{ {
return "{\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + "" + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "参数解析错误" + "\"}";
} }
string url = param.url; string url = param.url;
bool ispaly = param.ispaye; bool ispaly = param.ispaye;
if (!isFuncisFuncObject("PalyFile")) if (!isFuncisFuncObject("PalyFile"))
{ {
//Utils.MessagesBox("音频设备未授权使用"); //Utils.MessagesBox("音频设备未授权使用");
return "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "音频设备未授权使用" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + "音频设备未授权使用" + "\"}";
} }
else else
{ {
@ -914,7 +914,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
//AutoAudio(ispaly, ""); //AutoAudio(ispaly, "");
}); });
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "停止播放成功" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "停止播放成功" + "\"}";
SubmitLogs(result, "PalyFile"); SubmitLogs(result, "PalyFile");
return result; return result;
} }
@ -967,7 +967,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
ShllCommad(command); ShllCommad(command);
//AutoAudio(ispaly, path); //AutoAudio(ispaly, path);
}); });
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "开始播放" + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"data\":\"" + "开始播放" + "\"}";
SubmitLogs(result, "PalyFile"); SubmitLogs(result, "PalyFile");
return result; return result;
} }
@ -975,7 +975,7 @@ namespace AKS.EnterpriseLibrary.WebBrowser
} }
catch (Exception ex) catch (Exception ex)
{ {
string result = "{\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; string result = "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"keycode\":\"" + param.code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
SubmitLogs(result, "PalyFile"); SubmitLogs(result, "PalyFile");
return result; return result;
} }
@ -994,12 +994,12 @@ namespace AKS.EnterpriseLibrary.WebBrowser
{ {
Bash("/usr/bin/python3 /usr/bin/onboard"); Bash("/usr/bin/python3 /usr/bin/onboard");
}); });
return "{\"keycode\":\"" + code + "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"" + "唤醒键盘成功" + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"seccse\",\"code\":\"200\",\"status\":true,\"data\":\"" + "唤醒键盘成功" + "\"}";
} }
catch (Exception ex) catch (Exception ex)
{ {
//Log.Error("唤醒键盘异常: " + ex.Message + ""); //Log.Error("唤醒键盘异常: " + ex.Message + "");
return "{\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}"; return "{\"timestamp\":\"" + Utils.GetTimestamp()+ "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"data\":\"" + ex.Message + "\"}";
} }
} }

Loading…
Cancel
Save