feat:完成注册功能

This commit is contained in:
橙子
2023-03-29 23:20:54 +08:00
parent 769e2cb897
commit bcf7802f94
4 changed files with 27 additions and 5 deletions

View File

@@ -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 });

View File

@@ -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";
}
}