|
@@ -267,7 +267,7 @@ namespace IES.ExamServer.Controllers
|
|
|
{
|
|
|
var type = json["type"];
|
|
|
string qrcode = string.Empty;
|
|
|
- string randomCode = "";
|
|
|
+ string randomcode = "";
|
|
|
_memoryCache.TryGetValue(Constant._KeyServerDevice, out ServerDevice? server);
|
|
|
School? school = null;
|
|
|
if (server != null)
|
|
@@ -284,22 +284,22 @@ namespace IES.ExamServer.Controllers
|
|
|
|
|
|
// 生成二维码图片
|
|
|
Random random = new Random();
|
|
|
- randomCode = $"{random.Next(1000, 9999)}";
|
|
|
+ randomcode = $"{random.Next(1000, 9999)}";
|
|
|
string? CenterUrl = _configuration.GetValue<string>("ExamServer:CenterUrl");
|
|
|
CenterUrl = CenterUrl.Equals("https://localhost:5001") ? "https://www.teammodel.cn" : CenterUrl;
|
|
|
- string content = $"{CenterUrl}/qrcodelogin?randomcode=login:{school?.id}:{randomCode}&m=%E6%89%AB%E7%A0%81%E7%99%BB%E5%BD%95&o=1";
|
|
|
+ string content = $"{CenterUrl}/qrcodelogin?randomcode=login:{school?.id}:{randomcode}&m=%E6%89%AB%E7%A0%81%E7%99%BB%E5%BD%95&o=1";
|
|
|
var str = QRCodeHelper.GenerateQRCode(content, 300, 300, QRCodeHelper.logo);
|
|
|
qrcode = $"data:image/png;base64,{str}";
|
|
|
- return Ok(new { code = 200, randomCode = randomCode, qrcode, type });
|
|
|
+ return Ok(new { code = 200, randomCode = randomcode, qrcode, type });
|
|
|
}
|
|
|
case bool when $"{type}".Equals("xqrcode"):
|
|
|
{
|
|
|
// 生成二维码图片
|
|
|
Random random = new Random();
|
|
|
- randomCode = $"{random.Next(1000, 9999)}";
|
|
|
+ randomcode = $"{random.Next(1000, 9999)}";
|
|
|
string? CenterUrl = _configuration.GetValue<string>("ExamServer:CenterUrl");
|
|
|
CenterUrl = CenterUrl.Equals("https://localhost:5001") ? "https://www.teammodel.cn" : CenterUrl;
|
|
|
- string content = $"{CenterUrl}/qrcodelogin?code=randomcode:{school?.id}:{randomCode}&m=%E6%89%AB%E7%A0%81%E7%99%BB%E5%BD%95&o=1";
|
|
|
+ string content = $"{CenterUrl}/qrcodelogin?code=randomcode:{school?.id}:{randomcode}&m=%E6%89%AB%E7%A0%81%E7%99%BB%E5%BD%95&o=1";
|
|
|
Bitmap qrCodeImage = QRCodeHelper.GetBitmap(content, 200, 200);
|
|
|
using (MemoryStream stream = new MemoryStream())
|
|
|
{
|
|
@@ -307,7 +307,7 @@ namespace IES.ExamServer.Controllers
|
|
|
byte[] data = stream.ToArray();
|
|
|
qrcode = $"data:image/png;base64,{Convert.ToBase64String(data)}";
|
|
|
}
|
|
|
- return Ok(new { code = 200, randomCode = randomCode, qrcode, type });
|
|
|
+ return Ok(new { code = 200, randomCode = randomcode, qrcode, type });
|
|
|
}
|
|
|
case bool when $"{type}".Equals("smspin"):
|
|
|
{
|