|
|
@ -396,7 +396,7 @@ namespace AksWebBrowser.Common |
|
|
|
if (jo2["code"].ToString() == "0") |
|
|
|
if (jo2["code"].ToString() == "0") |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (type == "open" && typeCode == 1) |
|
|
|
if (type == "open" && typeCode == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
|
//读取指纹 |
|
|
|
//读取指纹 |
|
|
|
if (typeCode == 1) |
|
|
|
if (typeCode == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -497,17 +497,25 @@ namespace AksWebBrowser.Common |
|
|
|
public async Task<string> PublicFinger(string type, int typeCode, int timeout) |
|
|
|
public async Task<string> PublicFinger(string type, int typeCode, int timeout) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string body = string.Empty; |
|
|
|
string body = string.Empty; |
|
|
|
timeout = timeout == 0 ? Parame.timeout : timeout; |
|
|
|
try |
|
|
|
var client = new HttpClient(); |
|
|
|
|
|
|
|
client.Timeout = TimeSpan.FromSeconds(timeout); |
|
|
|
|
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, Parame.signUrl); |
|
|
|
|
|
|
|
var content = new StringContent("{\r\n \"command\": \"finger\",\r\n \"command_num\": 121,\r\n \"data\": {\r\n \"operation\": \"" + type + "\",\r\n \"operation_code\": " + typeCode + ",\r\n \"parameters\": {\r\n }\r\n }\r\n}", null, "text/plain"); |
|
|
|
|
|
|
|
request.Content = content; |
|
|
|
|
|
|
|
var response = await client.SendAsync(request); |
|
|
|
|
|
|
|
response.EnsureSuccessStatusCode(); |
|
|
|
|
|
|
|
if (response.StatusCode.ToString() == "OK") |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
body = await response.Content.ReadAsStringAsync(); |
|
|
|
timeout = timeout == 0 ? Parame.timeout : timeout; |
|
|
|
|
|
|
|
var client = new HttpClient(); |
|
|
|
|
|
|
|
client.Timeout = TimeSpan.FromSeconds(timeout); |
|
|
|
|
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, Parame.signUrl); |
|
|
|
|
|
|
|
var content = new StringContent("{\r\n \"command\": \"finger\",\r\n \"command_num\": 121,\r\n \"data\": {\r\n \"operation\": \"" + type + "\",\r\n \"operation_code\": " + typeCode + ",\r\n \"parameters\": {\r\n }\r\n }\r\n}", null, "text/plain"); |
|
|
|
|
|
|
|
request.Content = content; |
|
|
|
|
|
|
|
var response = await client.SendAsync(request); |
|
|
|
|
|
|
|
response.EnsureSuccessStatusCode(); |
|
|
|
|
|
|
|
if (response.StatusCode.ToString() == "OK") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
body = await response.Content.ReadAsStringAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ""; |
|
|
|
} |
|
|
|
} |
|
|
|
return body; |
|
|
|
return body; |
|
|
|
} |
|
|
|
} |
|
|
@ -604,19 +612,60 @@ namespace AksWebBrowser.Common |
|
|
|
public async Task<string> PublicIdcard(string type, int typeCode, int timeout) |
|
|
|
public async Task<string> PublicIdcard(string type, int typeCode, int timeout) |
|
|
|
{ |
|
|
|
{ |
|
|
|
string body = string.Empty; |
|
|
|
string body = string.Empty; |
|
|
|
timeout = timeout == 0 ? Parame.timeout : timeout; |
|
|
|
try |
|
|
|
var client = new HttpClient(); |
|
|
|
|
|
|
|
client.Timeout = TimeSpan.FromSeconds(timeout); |
|
|
|
|
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, Parame.signUrl); |
|
|
|
|
|
|
|
var content = new StringContent("{\r\n \"command\": \"idcard\",\r\n \"command_num\": 141,\r\n \"data\": {\r\n \"operation\": \"close\",\r\n \"operation_code\": 2,\r\n \"parameters\": {\r\n }\r\n }\r\n}", null, "text/plain"); |
|
|
|
|
|
|
|
request.Content = content; |
|
|
|
|
|
|
|
var response = await client.SendAsync(request); |
|
|
|
|
|
|
|
response.EnsureSuccessStatusCode(); |
|
|
|
|
|
|
|
if (response.StatusCode.ToString() == "OK") |
|
|
|
|
|
|
|
{ |
|
|
|
{ |
|
|
|
body = await response.Content.ReadAsStringAsync(); |
|
|
|
timeout = timeout == 0 ? Parame.timeout : timeout; |
|
|
|
|
|
|
|
var client = new HttpClient(); |
|
|
|
|
|
|
|
client.Timeout = TimeSpan.FromSeconds(timeout); |
|
|
|
|
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, Parame.signUrl); |
|
|
|
|
|
|
|
var content = new StringContent("{\r\n \"command\": \"idcard\",\r\n \"command_num\": 141,\r\n \"data\": {\r\n \"operation\": \"close\",\r\n \"operation_code\": 2,\r\n \"parameters\": {\r\n }\r\n }\r\n}", null, "text/plain"); |
|
|
|
|
|
|
|
request.Content = content; |
|
|
|
|
|
|
|
var response = await client.SendAsync(request); |
|
|
|
|
|
|
|
response.EnsureSuccessStatusCode(); |
|
|
|
|
|
|
|
if (response.StatusCode.ToString() == "OK") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
body = await response.Content.ReadAsStringAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return ""; |
|
|
|
} |
|
|
|
} |
|
|
|
return body; |
|
|
|
return body; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|
|
|
/// 获取问题 |
|
|
|
|
|
|
|
/// </summary> |
|
|
|
|
|
|
|
/// <param name="PetitionId"></param> |
|
|
|
|
|
|
|
/// <param name="PId"></param> |
|
|
|
|
|
|
|
/// <param name="Name"></param> |
|
|
|
|
|
|
|
/// <param name="PageIndex"></param> |
|
|
|
|
|
|
|
/// <param name="PageSize"></param> |
|
|
|
|
|
|
|
/// <returns></returns> |
|
|
|
|
|
|
|
public async Task<string> GetQuestionAnswer(string PetitionId, string PId, string Name, int PageIndex, int PageSize) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
string body = string.Empty; |
|
|
|
|
|
|
|
try |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var client = new HttpClient(); |
|
|
|
|
|
|
|
var request = new HttpRequestMessage(HttpMethod.Post, Parame.qwUrl + "/api/QuestionAnswer/Query"); |
|
|
|
|
|
|
|
var content = new StringContent("{\r\n \"PetitionId\": \"" + PetitionId + "\",\r\n \"PId\": \"" + PId + "\",\r\n \"Name\": \"" + Name + "\",\r\n \"PageIndex\": " + PageIndex + ",\r\n \"PageSize\": " + PageSize + "\r\n}", null, "application/json"); |
|
|
|
|
|
|
|
request.Content = content; |
|
|
|
|
|
|
|
var response = await client.SendAsync(request); |
|
|
|
|
|
|
|
response.EnsureSuccessStatusCode(); |
|
|
|
|
|
|
|
if (response.StatusCode.ToString() == "OK") |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
body = await response.Content.ReadAsStringAsync(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return ""; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return body; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|