diff --git a/asg_form/Controllers/Teamregistration/RegisterController.cs b/asg_form/Controllers/Teamregistration/RegisterController.cs index 12d6654..5459df8 100644 --- a/asg_form/Controllers/Teamregistration/RegisterController.cs +++ b/asg_form/Controllers/Teamregistration/RegisterController.cs @@ -26,6 +26,7 @@ namespace asg_form.Controllers.Teamregistration } public class userMsg { + public long id { get; set; } public string chinaname { get; set; } public int userId { get; set; } public int sex { get; set; } @@ -33,7 +34,7 @@ namespace asg_form.Controllers.Teamregistration public string gameId { get; set; } public string historyRank { get; set; } public string contactNumber { get; set; } - public long id { get; set; } + } public class RegisterController : ControllerBase { @@ -50,12 +51,11 @@ namespace asg_form.Controllers.Teamregistration [HttpPost] [Authorize] public async Task> UserRgst([FromBody] userMsg msg) - { - string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; + { //var userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; using (TestDbContext sub = new TestDbContext()) { - if (sub.T_Comform.Find(userId) != null) + if (sub.T_Comform.Find(msg.userId) != null) { return Ok(new error_mb { code = 400, message = "你已经提交过表单了,请不要重复提交" }); }