Browse Source

Merge pull request #7781 from abpframework/liangshiwei/account

Make RegisterDto of account module extensible.
pull/7784/head
maliming 5 years ago
committed by GitHub
parent
commit
f2c06cae77
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs
  2. 3
      modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs

5
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs

@ -1,11 +1,12 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Auditing;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Validation;
namespace Volo.Abp.Account
{
public class RegisterDto
public class RegisterDto : ExtensibleObject
{
[Required]
[DynamicStringLength(typeof(IdentityUserConsts), nameof(IdentityUserConsts.MaxUserNameLength))]
@ -25,4 +26,4 @@ namespace Volo.Abp.Account
[Required]
public string AppName { get; set; }
}
}
}

3
modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.cs

@ -6,6 +6,7 @@ using Volo.Abp.Account.Localization;
using Volo.Abp.Account.Settings;
using Volo.Abp.Application.Services;
using Volo.Abp.Identity;
using Volo.Abp.ObjectExtending;
using Volo.Abp.Settings;
namespace Volo.Abp.Account
@ -42,6 +43,8 @@ namespace Volo.Abp.Account
var user = new IdentityUser(GuidGenerator.Create(), input.UserName, input.EmailAddress, CurrentTenant.Id);
input.MapExtraPropertiesTo(user);
(await UserManager.CreateAsync(user, input.Password)).CheckErrors();
await UserManager.SetEmailAsync(user,input.EmailAddress);

Loading…
Cancel
Save