|
@@ -421,7 +421,7 @@ namespace TEAMModelOS.Controllers
|
|
|
[ProducesDefaultResponseType]
|
|
|
[HttpPost("qrcode/login")]
|
|
|
//[Authorize(Roles = "HiTA")]
|
|
|
- public async Task<IActionResult> SchoolJoin(HiTAJoinSchool join)
|
|
|
+ public async Task<IActionResult> SchoolJoin(QRCodeLoginCheck join)
|
|
|
{
|
|
|
try
|
|
|
{
|
|
@@ -445,7 +445,7 @@ namespace TEAMModelOS.Controllers
|
|
|
await _azureRedis.GetRedisClient(8).StringSetAsync($"HiTA:Login:{join.randomcode.Replace("login:", "")}", id, expiry: new TimeSpan(0, 0, 30));
|
|
|
return Ok(new { msg = "关闭弹窗以获取登录信息" ,code=200});
|
|
|
}
|
|
|
- else { return Ok(new { code = 400, msg = "参数错误" }); }
|
|
|
+ else { return Ok(new { code = 400, msg = $"参数错误{join.ToJsonString()}" }); }
|
|
|
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -457,7 +457,7 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
[ProducesDefaultResponseType]
|
|
|
[HttpGet("qrcode/check")]
|
|
|
- public async Task<IActionResult> QRCodeCheck([FromQuery] HiTAJoinSchool join)
|
|
|
+ public async Task<IActionResult> QRCodeCheck([FromQuery] QRCodeLoginCheck join)
|
|
|
{
|
|
|
int timezone = 8;
|
|
|
if (HttpContext.Request.Headers.TryGetValue("Time-Zone", out var Time_Zone) && int.TryParse(Time_Zone, out int tz))
|
|
@@ -468,8 +468,7 @@ namespace TEAMModelOS.Controllers
|
|
|
string school = join.school;
|
|
|
if (!string.IsNullOrWhiteSpace(join.randomcode)&& !string.IsNullOrWhiteSpace(school))
|
|
|
{
|
|
|
-
|
|
|
- var data = await _azureRedis.GetRedisClient(8).StringGetAsync($"HiTA:Login:{school}:{join.randomcode}");
|
|
|
+ var data = await _azureRedis.GetRedisClient(8).StringGetAsync($"HiTA:Login:{join.client}:{school}:{join.randomcode}");
|
|
|
if (data.HasValue)
|
|
|
{
|
|
|
tmdid = data.ToString();
|
|
@@ -1287,7 +1286,12 @@ namespace TEAMModelOS.Controllers
|
|
|
|
|
|
|
|
|
public class QRCodeLoginCheck
|
|
|
- { }
|
|
|
+ {
|
|
|
+ public string randomcode { get; set;}
|
|
|
+ public string school { get; set; }
|
|
|
+ public string client { get; set; }
|
|
|
+ public string id_token { get; set;}
|
|
|
+ }
|
|
|
public record ApplySchool
|
|
|
{
|
|
|
/// <summary>
|