222
This commit is contained in:
parent
6ca43f5d37
commit
af59007db1
@ -225,20 +225,13 @@ namespace asg_form.Controllers
|
|||||||
public async Task<ActionResult<object>> Gethaveop()
|
public async Task<ActionResult<object>> Gethaveop()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (this.User.FindAll(ClaimTypes.Role).Any(a => a.Value == "admin"))
|
|
||||||
{
|
|
||||||
using (TestDbContext ctx = new TestDbContext())
|
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();
|
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;
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return BadRequest(new error_mb { code = 400, message = "无权访问" });
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user