This commit is contained in:
王炜翔 2024-09-04 10:40:51 +08:00
parent 4effb66e28
commit 0f80456dc6

View File

@ -114,7 +114,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 == "nadmin"))
if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin"))
{
return Ok(new error_mb { code = 401, message = "无权访问" });
}
@ -164,7 +164,7 @@ namespace asg_form.Controllers
{
//string encodedChinaname = HttpUtility.UrlEncode(chinaname);
if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nadmin"))
if (!this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin"))
{
return Ok(new error_mb { code = 401, message = "无权访问" });
}