This commit is contained in:
王炜翔 2024-10-14 09:49:45 +08:00
parent 7976d31b1a
commit f67262967c

View File

@ -67,7 +67,7 @@ namespace asg_form.Controllers
string Invitorid = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value; string Invitorid = this.User.FindFirst(ClaimTypes.NameIdentifier)!.Value;
var user = await userManager.FindByIdAsync(Invitorid); var user = await userManager.FindByIdAsync(Invitorid);
long userId = user.Id; long userId = user.Id;
if (user.officium != "Commentator" || this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin")) return Ok(new error_mb { code = 401, message = "您不是解说无法完成邀请" }); if (user.officium != "Commentator" || !this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "nbadmin")) return Ok(new error_mb { code = 401, message = "您不是解说无法完成邀请" });
using (TestDbContext sb = new TestDbContext()) using (TestDbContext sb = new TestDbContext())
{ {
try try