feat: 新增找回密码功能接口

This commit is contained in:
橙子
2024-10-03 01:10:32 +08:00
parent 94ee0fb058
commit d7629763ef
13 changed files with 362 additions and 222 deletions

View File

@@ -180,6 +180,8 @@ namespace Yi.Framework.Rbac.Domain.Managers
}
return false;
}
/// <summary>
/// 令牌转换
@@ -250,7 +252,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
}
/// <summary>
/// 重置密码
/// 重置密码,也可以是找回密码
/// </summary>
/// <param name="userId"></param>
/// <param name="password"></param>
@@ -258,7 +260,6 @@ namespace Yi.Framework.Rbac.Domain.Managers
public async Task<bool> RestPasswordAsync(Guid userId, string password)
{
var user = await _repository.GetByIdAsync(userId);
// EntityHelper.TrySetId(user, () => GuidGenerator.Create(), true);
user.EncryPassword.Password = password;
user.BuildPassword();
return await _repository.UpdateAsync(user);
@@ -276,7 +277,6 @@ namespace Yi.Framework.Rbac.Domain.Managers
var user = new UserAggregateRoot(userName, password, phone,nick);
await _userManager.CreateAsync(user);
await _userManager.SetDefautRoleAsync(user.Id);
}
}