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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
6 additions and
2 deletions
-
modules/account/src/Volo.Abp.Account.Application.Contracts/Volo/Abp/Account/RegisterDto.cs
-
modules/account/src/Volo.Abp.Account.Application/Volo/Abp/Account/AccountAppService.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; } |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
@ -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); |
|
|
|
|