mirror of
https://github.com/anjoy8/Blog.Core.git
synced 2024-09-20 23:48:27 +08:00
Update PermissionController.cs
This commit is contained in:
parent
5e4987d2f6
commit
1be389ad64
|
@ -347,8 +347,14 @@ namespace Blog.Core.Controllers
|
|||
{
|
||||
// ids4
|
||||
uidInHttpcontext1 = (from item in _httpContext.HttpContext.User.Claims
|
||||
where item.Type == "sub"
|
||||
where item.Type == ClaimTypes.NameIdentifier
|
||||
select item.Value).FirstOrDefault().ObjToLong();
|
||||
if (!(uidInHttpcontext1 > 0))
|
||||
{
|
||||
uidInHttpcontext1 = (from item in _httpContext.HttpContext.User.Claims
|
||||
where item.Type == "sub"
|
||||
select item.Value).FirstOrDefault().ObjToLong();
|
||||
}
|
||||
roleIds = (from item in _httpContext.HttpContext.User.Claims
|
||||
where item.Type == ClaimTypes.Role
|
||||
select item.Value.ObjToLong()).ToList();
|
||||
|
@ -444,8 +450,14 @@ namespace Blog.Core.Controllers
|
|||
{
|
||||
// ids4
|
||||
uidInHttpcontext1 = (from item in _httpContext.HttpContext.User.Claims
|
||||
where item.Type == "sub"
|
||||
where item.Type == ClaimTypes.NameIdentifier
|
||||
select item.Value).FirstOrDefault().ObjToLong();
|
||||
if (!(uidInHttpcontext1 > 0))
|
||||
{
|
||||
uidInHttpcontext1 = (from item in _httpContext.HttpContext.User.Claims
|
||||
where item.Type == "sub"
|
||||
select item.Value).FirstOrDefault().ObjToLong();
|
||||
}
|
||||
roleIds = (from item in _httpContext.HttpContext.User.Claims
|
||||
where item.Type == ClaimTypes.Role
|
||||
select item.Value.ObjToLong()).ToList();
|
||||
|
|
Loading…
Reference in New Issue
Block a user