优化登录权限存储jwt
This commit is contained in:
@@ -91,9 +91,9 @@ namespace ZR.Admin.WebApi.Extensions
|
||||
}
|
||||
else if ("2".Equals(dataScope))
|
||||
{
|
||||
var roleDepts = db0.Queryable<SysRoleDept>()
|
||||
.Where(f => f.RoleId == role.RoleId).Select(f => f.DeptId).ToList();
|
||||
var filter1 = new TableFilterItem<SysDept>(it => roleDepts.Contains(it.DeptId));
|
||||
//var roleDepts = db0.Queryable<SysRoleDept>()
|
||||
//.Where(f => f.RoleId == role.RoleId).Select(f => f.DeptId).ToList();
|
||||
//var filter1 = new TableFilterItem<SysDept>(it => roleDepts.Contains(it.DeptId));
|
||||
}
|
||||
else if ("3".Equals(dataScope))
|
||||
{
|
||||
|
||||
@@ -137,14 +137,6 @@ namespace ZR.Admin.WebApi.Extensions
|
||||
new Claim(ClaimTypes.Name, user.UserName),
|
||||
new Claim(ClaimTypes.UserData, JsonConvert.SerializeObject(user))
|
||||
};
|
||||
if (user.RoleIds != null)
|
||||
{
|
||||
claims.Add(new Claim(ClaimTypes.Role, string.Join(",", user.RoleIds)));
|
||||
}
|
||||
if (user.Permissions != null)
|
||||
{
|
||||
claims.Add(new Claim("perm", string.Join(",", user.Permissions)));
|
||||
}
|
||||
|
||||
//写入Cookie
|
||||
//WhiteCookie(context, claims);
|
||||
|
||||
Reference in New Issue
Block a user