feat:完成注册功能
This commit is contained in:
@@ -186,7 +186,7 @@ namespace Yi.RBAC.Application.Identity
|
||||
var entity = await _userRepository.InsertReturnEntityAsync(newUser);
|
||||
//赋上一个初始角色
|
||||
var roleRepository = _roleRepository;
|
||||
var role = await roleRepository.GetFirstAsync(x => x.RoleName == UserConst.GuestRoleName);
|
||||
var role = await roleRepository.GetFirstAsync(x => x.RoleCode == UserConst.GuestRoleCode);
|
||||
if (role is not null)
|
||||
{
|
||||
await _userManager.GiveUserSetRoleAsync(new List<long> { entity.Id }, new List<long> { role.Id });
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace Yi.RBAC.Domain.Shared.Identity.ConstClasses
|
||||
public const string AdminRolesCode = "admin";
|
||||
public const string AdminPermissionCode = "*:*:*";
|
||||
|
||||
public const string GuestRoleName = "guest";
|
||||
public const string GuestRoleCode = "guest";
|
||||
public const string CommonRoleName = "common";
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user