refactor: 更新扩展服务
This commit is contained in:
parent
647cc252d4
commit
c0c417ca29
|
@ -1,6 +1,4 @@
|
||||||
using BootstrapAdmin.Web.Services;
|
using BootstrapAdmin.Web.Services;
|
||||||
using Microsoft.AspNetCore.Authentication.Cookies;
|
|
||||||
using Microsoft.AspNetCore.Components.Authorization;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Microsoft.Extensions.DependencyInjection
|
namespace Microsoft.Extensions.DependencyInjection
|
||||||
|
@ -64,7 +62,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
services.AddBootstrapBlazor();
|
services.AddBootstrapBlazor();
|
||||||
|
|
||||||
// 增加认证授权服务
|
// 增加认证授权服务
|
||||||
services.AddBootstrapAdminAuthentication<RoleService>();
|
services.AddBootstrapAdminSecurity<AdminService>();
|
||||||
|
|
||||||
// 增加 BootstrapApp 上下文服务
|
// 增加 BootstrapApp 上下文服务
|
||||||
services.AddSingleton<BootstrapAppContext>();
|
services.AddSingleton<BootstrapAppContext>();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace BootstrapAdmin.Web.Services
|
namespace BootstrapAdmin.Web.Services
|
||||||
{
|
{
|
||||||
class RoleService : IRoleService
|
class AdminService : IBootstrapAdminService
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 通过当前登录用户名获取角色集合方法
|
/// 通过当前登录用户名获取角色集合方法
|
||||||
|
@ -10,5 +10,12 @@ namespace BootstrapAdmin.Web.Services
|
||||||
/// <param name="userName"></param>
|
/// <param name="userName"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public List<string> GetRolesByUserName(string userName) => new List<string>() { "Administrators" };
|
public List<string> GetRolesByUserName(string userName) => new List<string>() { "Administrators" };
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
///
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="userName"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public List<string> GetAppsByUserName(string userName) => new List<string>() { "BA" };
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue