You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
1 year ago | |
|---|---|---|
| .. | ||
| LINGYUN/Abp/Identity | 2 years ago | |
| FodyWeavers.xml | 4 years ago | |
| FodyWeavers.xsd | 4 years ago | |
| LINGYUN.Abp.Identity.Application.csproj | 2 years ago | |
| README.EN.md | 1 year ago | |
| README.md | 1 year ago | |
README.md
LINGYUN.Abp.Identity.Application
身份认证应用服务模块,提供身份认证相关的应用服务实现。
功能特性
- 扩展Volo.Abp.Identity.AbpIdentityApplicationModule模块
- 提供身份认证相关的应用服务实现
- 集成AutoMapper对象映射
- 支持用户头像URL扩展属性
模块引用
[DependsOn(
typeof(AbpIdentityApplicationModule),
typeof(AbpIdentityApplicationContractsModule),
typeof(AbpIdentityDomainModule))]
public class YouProjectModule : AbpModule
{
// other
}
应用服务
- IdentityUserAppService - 用户管理服务
- IdentityRoleAppService - 角色管理服务
- IdentityClaimTypeAppService - 声明类型管理服务
- IdentitySecurityLogAppService - 安全日志服务
- IdentitySettingsAppService - 身份认证设置服务
- ProfileAppService - 用户配置文件服务
对象映射
模块使用AutoMapper进行对象映射,主要映射包括:
- IdentityUser -> IdentityUserDto
- IdentityRole -> IdentityRoleDto
- IdentityClaimType -> IdentityClaimTypeDto
- IdentitySecurityLog -> IdentitySecurityLogDto
基本用法
- 使用用户管理服务
public class YourService
{
private readonly IIdentityUserAppService _userAppService;
public YourService(IIdentityUserAppService userAppService)
{
_userAppService = userAppService;
}
public async Task<IdentityUserDto> GetUserAsync(Guid id)
{
return await _userAppService.GetAsync(id);
}
}
- 使用角色管理服务
public class YourService
{
private readonly IIdentityRoleAppService _roleAppService;
public YourService(IIdentityRoleAppService roleAppService)
{
_roleAppService = roleAppService;
}
public async Task<IdentityRoleDto> GetRoleAsync(Guid id)
{
return await _roleAppService.GetAsync(id);
}
}