|
@@ -172,25 +172,33 @@ namespace IES.ExamServer.Controllers
|
|
|
{
|
|
|
string randomCode = $"{json["randomCode"]}";
|
|
|
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
|
|
|
-
|
|
|
- var response = await _httpClientFactory.CreateClient().GetAsync($"{CenterUrl}/core/qrcode/check?randomcode={randomCode}&school={school?.id}&client=ExamServer");
|
|
|
- if (response.IsSuccessStatusCode)
|
|
|
+ var rc= _memoryCache.Get<string>($"Login:ExamServer:{school?.id}:{randomCode}");
|
|
|
+ if (!string.IsNullOrWhiteSpace(rc))
|
|
|
{
|
|
|
- string content = await response.Content.ReadAsStringAsync();
|
|
|
- if (!string.IsNullOrWhiteSpace(content))
|
|
|
+ var response = await _httpClientFactory.CreateClient().GetAsync($"{CenterUrl}/core/qrcode/check?randomcode={randomCode}&school={school?.id}&client=ExamServer");
|
|
|
+ if (response.IsSuccessStatusCode)
|
|
|
{
|
|
|
- jsonNode = content.ToObject<JsonNode>();
|
|
|
+ string content = await response.Content.ReadAsStringAsync();
|
|
|
+ if (!string.IsNullOrWhiteSpace(content))
|
|
|
+ {
|
|
|
+ jsonNode = content.ToObject<JsonNode>();
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ code=400;
|
|
|
+ msg="随机码验证失败";
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
code=400;
|
|
|
- msg="随机码验证失败";
|
|
|
+ msg="随机码验证错误";
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
code=400;
|
|
|
- msg="随机码验证错误";
|
|
|
+ msg="二维码过期";
|
|
|
}
|
|
|
break;
|
|
|
}
|