???
This commit is contained in:
parent
a907e26710
commit
41bb3f1d1e
@ -26,6 +26,7 @@ namespace asg_form.Controllers.Teamregistration
|
|||||||
}
|
}
|
||||||
public class userMsg
|
public class userMsg
|
||||||
{
|
{
|
||||||
|
public long id { get; set; }
|
||||||
public string chinaname { get; set; }
|
public string chinaname { get; set; }
|
||||||
public int userId { get; set; }
|
public int userId { get; set; }
|
||||||
public int sex { get; set; }
|
public int sex { get; set; }
|
||||||
@ -33,7 +34,7 @@ namespace asg_form.Controllers.Teamregistration
|
|||||||
public string gameId { get; set; }
|
public string gameId { get; set; }
|
||||||
public string historyRank { get; set; }
|
public string historyRank { get; set; }
|
||||||
public string contactNumber { get; set; }
|
public string contactNumber { get; set; }
|
||||||
public long id { get; set; }
|
|
||||||
}
|
}
|
||||||
public class RegisterController : ControllerBase
|
public class RegisterController : ControllerBase
|
||||||
{
|
{
|
||||||
@ -50,12 +51,11 @@ namespace asg_form.Controllers.Teamregistration
|
|||||||
[HttpPost]
|
[HttpPost]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult<object>> UserRgst([FromBody] userMsg msg)
|
public async Task<ActionResult<object>> UserRgst([FromBody] userMsg msg)
|
||||||
{
|
{ //var userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
||||||
string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
|
|
||||||
|
|
||||||
using (TestDbContext sub = new TestDbContext())
|
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 = "你已经提交过表单了,请不要重复提交" });
|
return Ok(new error_mb { code = 400, message = "你已经提交过表单了,请不要重复提交" });
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user