用户发送邮件
This commit is contained in:
@@ -154,13 +154,14 @@ namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string UserCode { get; set; } = string.Empty;
|
||||
|
||||
public int VerificationCode { get; set; }
|
||||
}
|
||||
|
||||
|
||||
public class UserCommand : UserInfo
|
||||
{
|
||||
{
|
||||
|
||||
public string RoutUrl { get; set; } = string.Empty;
|
||||
|
||||
//public string FirstName { get; set; }
|
||||
//public string LastName { get; set; }
|
||||
}
|
||||
|
||||
@@ -245,6 +245,9 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
public async Task<IResponseOutput> ResetPassword(Guid userId)
|
||||
{
|
||||
|
||||
await _mailVerificationService.AdminResetPwdSendEmail(userId);
|
||||
|
||||
await _userRepository.UpdatePartialNowNoQueryAsync(userId, u => new User()
|
||||
{
|
||||
Password = MD5Helper.Md5(StaticData.DefaultPassword),
|
||||
@@ -470,8 +473,6 @@ namespace IRaCIS.Application.Services
|
||||
saveItem.OrganizationName = "Zhizhun";
|
||||
}
|
||||
|
||||
//验证码 6位
|
||||
int verificationCode = new Random().Next(100000, 1000000);
|
||||
|
||||
saveItem.Password = MD5Helper.Md5("123456");
|
||||
|
||||
@@ -479,7 +480,9 @@ namespace IRaCIS.Application.Services
|
||||
|
||||
var success = await _userRepository.SaveChangesAsync();
|
||||
|
||||
return ResponseOutput.Result(success, new UserAddedReturnDTO { Id = saveItem.Id, UserCode = saveItem.UserCode, VerificationCode = verificationCode });
|
||||
await _mailVerificationService.AddUserSendEmail(saveItem.Id, userAddModel.RoutUrl);
|
||||
|
||||
return ResponseOutput.Result(success, new UserAddedReturnDTO { Id = saveItem.Id, UserCode = saveItem.UserCode });
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user