|
|
|
@ -173,6 +173,8 @@ namespace AksWebBrowser.Common
|
|
|
|
|
jo2 = (JObject)JsonConvert.DeserializeObject(ret); |
|
|
|
|
if (jo2["code"].ToString() == "0") |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
//读取data数据 |
|
|
|
|
string data = jo["data"].ToString(); |
|
|
|
|
JObject jo3 = (JObject)JsonConvert.DeserializeObject(data); |
|
|
|
@ -184,16 +186,22 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
//Log.Error("请求签字失败" + jo["message"].ToString()); |
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if (jo2["code"].ToString() == "2") |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
return "{\"timestamp\":\"" + "" + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "取消签字" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
if (type == "open" && typeCode == 1) |
|
|
|
|
{ |
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}"; |
|
|
|
@ -206,21 +214,29 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
else if (jo2["code"].ToString() == "2") |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
return "{\"timestamp\":\"" + "" + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "取消签字" + "\"}"; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
//Log.Error("请求签字失败" + jo["message"].ToString()); |
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"success\",\"code\":\"200\",\"status\":true,\"suffix\":\"png\",\"data\":\"" + "关闭成功" + "\"}"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
if (type == "open" && typeCode == 1) |
|
|
|
|
{ |
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "签字失败" + "\"}"; |
|
|
|
@ -233,6 +249,8 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|
//关闭签字版 |
|
|
|
|
await PublicSign("close", 2, timeout); |
|
|
|
|
if (ex.Message.Contains("HttpClient.Timeout")) |
|
|
|
|
{ |
|
|
|
|
return "{\"timestamp\":\"" + Utils.GetTimestamp() + "\",\"keycode\":\"" + code + "\",\"message\":\"Falied\",\"code\":\"400\",\"status\":false,\"suffix\":\"png\",\"data\":\"" + "在规定时间内未签字" + "\"}"; |
|
|
|
@ -295,7 +313,6 @@ namespace AksWebBrowser.Common
|
|
|
|
|
JObject jo2 = (JObject)JsonConvert.DeserializeObject(ret); |
|
|
|
|
if (jo2["code"].ToString() == "0") |
|
|
|
|
{ |
|
|
|
|
//读取data数据 |
|
|
|
|
//读取data数据 |
|
|
|
|
string data = jo["data"].ToString(); |
|
|
|
|
JObject jo3 = (JObject)JsonConvert.DeserializeObject(data); |
|
|
|
@ -341,7 +358,6 @@ namespace AksWebBrowser.Common
|
|
|
|
|
JObject jo2 = (JObject)JsonConvert.DeserializeObject(ret); |
|
|
|
|
if (jo2["code"].ToString() == "0") |
|
|
|
|
{ |
|
|
|
|
//读取data数据 |
|
|
|
|
//读取data数据 |
|
|
|
|
string data = jo["data"].ToString(); |
|
|
|
|
JObject jo3 = (JObject)JsonConvert.DeserializeObject(data); |
|
|
|
@ -400,6 +416,7 @@ namespace AksWebBrowser.Common
|
|
|
|
|
//读取指纹 |
|
|
|
|
if (typeCode == 1) |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
//读取data数据 |
|
|
|
|
string data = jo["data"].ToString(); |
|
|
|
|
JObject jo3 = (JObject)JsonConvert.DeserializeObject(data); |
|
|
|
@ -412,12 +429,14 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
//关闭指纹 |
|
|
|
|
return "200"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
//关闭指纹 |
|
|
|
|
return "200"; |
|
|
|
|
} |
|
|
|
@ -436,6 +455,7 @@ namespace AksWebBrowser.Common
|
|
|
|
|
jo2 = (JObject)JsonConvert.DeserializeObject(ret); |
|
|
|
|
if (jo2["code"].ToString() == "0") |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
//读取指纹 |
|
|
|
|
if (typeCode == 1) |
|
|
|
|
{ |
|
|
|
@ -457,13 +477,15 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else { return ""; } |
|
|
|
|
else { await PublicFinger("close", 2, timeout); return ""; } |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
//Log.Error("请求签字失败" + jo["message"].ToString()); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
@ -471,11 +493,13 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|
await PublicFinger("close", 2, timeout); |
|
|
|
|
if (ex.Message.Contains("HttpClient.Timeout")) |
|
|
|
|
{ |
|
|
|
|
return "HttpClient.Timeout"; |
|
|
|
@ -529,7 +553,7 @@ namespace AksWebBrowser.Common
|
|
|
|
|
try |
|
|
|
|
{ |
|
|
|
|
//关闭身份证 |
|
|
|
|
await PublicIdcard(type, typeCode, timeout); |
|
|
|
|
await PublicIdcard(timeout); |
|
|
|
|
timeout = timeout == 0 ? Parame.timeout : timeout; |
|
|
|
|
var client = new HttpClient(); |
|
|
|
|
client.Timeout = TimeSpan.FromSeconds(timeout); |
|
|
|
@ -549,6 +573,8 @@ namespace AksWebBrowser.Common
|
|
|
|
|
{ |
|
|
|
|
if (typeCode == 1) |
|
|
|
|
{ |
|
|
|
|
//关闭身份证 |
|
|
|
|
await PublicIdcard(timeout); |
|
|
|
|
//读取data数据 |
|
|
|
|
string data = jo["data"].ToString(); |
|
|
|
|
JObject jo3 = (JObject)JsonConvert.DeserializeObject(data); |
|
|
|
@ -575,23 +601,31 @@ namespace AksWebBrowser.Common
|
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭身份证 |
|
|
|
|
await PublicIdcard(timeout); |
|
|
|
|
//关闭 |
|
|
|
|
return "200"; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭身份证 |
|
|
|
|
await PublicIdcard(timeout); |
|
|
|
|
//Log.Error("请求签字失败" + jo["message"].ToString()); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
//关闭身份证 |
|
|
|
|
await PublicIdcard(timeout); |
|
|
|
|
return ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
catch (Exception ex) |
|
|
|
|
{ |
|
|
|
|
//关闭身份证 |
|
|
|
|
await PublicIdcard(timeout); |
|
|
|
|
if (ex.Message.Contains("HttpClient.Timeout")) |
|
|
|
|
{ |
|
|
|
|
return "HttpClient.Timeout"; |
|
|
|
@ -610,7 +644,7 @@ namespace AksWebBrowser.Common
|
|
|
|
|
/// <param name="typeCode"></param> |
|
|
|
|
/// <param name="timeout"></param> |
|
|
|
|
/// <returns></returns> |
|
|
|
|
public async Task<string> PublicIdcard(string type, int typeCode, int timeout) |
|
|
|
|
public async Task<string> PublicIdcard(int timeout) |
|
|
|
|
{ |
|
|
|
|
string body = string.Empty; |
|
|
|
|
try |
|
|
|
|