From af59007db1e378de0de2c2db6468241bfe34ab99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Sat, 7 Sep 2024 11:15:10 +0800 Subject: [PATCH] 222 --- asg_form/Controllers/excel.cs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/asg_form/Controllers/excel.cs b/asg_form/Controllers/excel.cs index 5cbeda0..41fd8ec 100644 --- a/asg_form/Controllers/excel.cs +++ b/asg_form/Controllers/excel.cs @@ -225,20 +225,13 @@ namespace asg_form.Controllers public async Task> Gethaveop() { - if (this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) - { using (TestDbContext ctx = new TestDbContext()) { object data = userManager.Users.Select(a => new { a.Id, a.UserName, a.chinaname, a.Email, a.officium }).Where(a => a.officium != null).GroupBy(a => a.officium).ToList(); return data; } - } - else - { - return BadRequest(new error_mb { code = 400, message = "无权访问" }); - } - + }