From 17b48ce7f4f3fad1e3651431e8cc649928dfe33a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E7=82=9C=E7=BF=94?= <2307953404@qq.com> Date: Tue, 18 Feb 2025 21:26:19 +0800 Subject: [PATCH] 1 --- asg_form/Controllers/BlackController.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/asg_form/Controllers/BlackController.cs b/asg_form/Controllers/BlackController.cs index 135d4fc..1002dc8 100644 --- a/asg_form/Controllers/BlackController.cs +++ b/asg_form/Controllers/BlackController.cs @@ -64,7 +64,7 @@ namespace asg_form.Controllers { string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; var user = await userManager.FindByIdAsync(userId); - if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin")||!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) + if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")||!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) { return Ok(new error_mb { code = 401, message = "无权访问" }); } @@ -113,7 +113,7 @@ namespace asg_form.Controllers { string userId = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; var user = await userManager.FindByIdAsync(userId); - if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin") || !this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) + if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin") || !this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) { return Ok(new error_mb { code = 401, message = "无权访问" }); } @@ -147,7 +147,7 @@ namespace asg_form.Controllers [Authorize] public async Task> blackDel([FromQuery] string idFind) { - if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin") || !this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) + if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin") || !this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin")) { return Ok(new error_mb { code = 401, message = "无权访问" }); }