完善动态菜单、设置角色等功能,修复登录问题
This commit is contained in:
Binary file not shown.
@@ -42,7 +42,7 @@ namespace Yi.Framework.Core
|
||||
|
||||
foreach (var m in menus)
|
||||
{
|
||||
claims.Add(new Claim("permission", m.PermissionCode));
|
||||
claims.Add(new Claim("permission", m.PermissionCode.ToString()));
|
||||
}
|
||||
|
||||
if (isRefresh)
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Yi.Framework.Model.Models
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName= "PermissionCode")]
|
||||
[SugarColumn(ColumnName="PermissionCode" )]
|
||||
public string PermissionCode { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
@@ -69,5 +69,15 @@ namespace Yi.Framework.Model.Models
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="TenantId" )]
|
||||
public long? TenantId { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="MenuIcon" )]
|
||||
public string MenuIcon { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="Router" )]
|
||||
public string Router { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,5 +54,10 @@ namespace Yi.Framework.Model.Models
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="ModifyUser" )]
|
||||
public long? ModifyUser { get; set; }
|
||||
/// <summary>
|
||||
///
|
||||
///</summary>
|
||||
[SugarColumn(ColumnName="RoleCode" )]
|
||||
public string RoleCode { get; set; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NEST" Version="7.16.0" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.0.7.5" />
|
||||
<PackageReference Include="SqlSugarCore" Version="5.0.7.8" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using SqlSugar;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Yi.Framework.Common.Helper;
|
||||
@@ -112,7 +113,7 @@ namespace Yi.Framework.Service
|
||||
//首先获取到该用户全部信息,导航到角色、菜单,(菜单需要去重,完全交给Set来处理即可)
|
||||
|
||||
//得到用户
|
||||
var user = await _repository._Db.Queryable<UserEntity>().Includes(u => u.Roles, r => r.Menus).InSingleAsync(userId);
|
||||
var user = await _repository._Db.Queryable<UserEntity>().Includes(u => u.Roles.Where(r=>r.IsDeleted==false).ToList(), r => r.Menus.Where(m=>m.IsDeleted==false).ToList()).InSingleAsync(userId);
|
||||
|
||||
//得到角色集合
|
||||
var roleList = user.Roles;
|
||||
|
||||
Reference in New Issue
Block a user