From 0f6d03d16bd18eaf1308be707ff3af32971f68bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Wed, 9 Oct 2024 13:39:44 +0800 Subject: [PATCH] 11 --- asg_form/Controllers/comform.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/asg_form/Controllers/comform.cs b/asg_form/Controllers/comform.cs index 737a312..d7dfa2b 100644 --- a/asg_form/Controllers/comform.cs +++ b/asg_form/Controllers/comform.cs @@ -214,8 +214,22 @@ namespace asg_form.Controllers public string createTime { get; set; } } + + [Route("api/v1/admin/refuseCom")] + [HttpGet] + [Authorize] + public async Task> refuse_com(int userId) + { + if (this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) + { + using (TestDbContext testDb = new TestDbContext()) + { + + } + } + return Ok(new error_mb { code = 401, message = "没有管理员,无法设置" }); + } } - - } +}