From 41bb3f1d1e1dbd61dbcf1319940fc1e51cd46351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Mon, 16 Sep 2024 20:50:59 +0800 Subject: [PATCH] ??? --- .../Controllers/Teamregistration/RegisterController.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 = "你已经提交过表单了,请不要重复提交" }); }