7 changed files with 151 additions and 104 deletions
@ -1,17 +1,6 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
namespace LINGYUN.Abp.Identity |
||||
using Volo.Abp.Identity; |
{ |
||||
using Volo.Abp.Validation; |
public class IdentityUserClaimCreateDto: IdentityUserClaimCreateOrUpdateDto |
||||
|
{ |
||||
namespace LINGYUN.Abp.Identity |
} |
||||
{ |
} |
||||
public class IdentityUserClaimCreateDto |
|
||||
{ |
|
||||
[Required] |
|
||||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] |
|
||||
public string ClaimType { get; set; } |
|
||||
|
|
||||
[Required] |
|
||||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
|
||||
public string ClaimValue { get; set; } |
|
||||
} |
|
||||
} |
|
||||
|
|||||
@ -0,0 +1,16 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp.Identity; |
||||
|
using Volo.Abp.Validation; |
||||
|
|
||||
|
namespace LINGYUN.Abp.Identity |
||||
|
{ |
||||
|
public abstract class IdentityUserClaimCreateOrUpdateDto |
||||
|
{ |
||||
|
[Required] |
||||
|
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimTypeLength))] |
||||
|
public string ClaimType { get; set; } |
||||
|
|
||||
|
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
||||
|
public string ClaimValue { get; set; } |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,6 @@ |
|||||
|
namespace LINGYUN.Abp.Identity |
||||
|
{ |
||||
|
public class IdentityUserClaimSetDto : IdentityUserClaimCreateDto |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
@ -1,13 +1,11 @@ |
|||||
using System.ComponentModel.DataAnnotations; |
using Volo.Abp.Identity; |
||||
using Volo.Abp.Identity; |
using Volo.Abp.Validation; |
||||
using Volo.Abp.Validation; |
|
||||
|
namespace LINGYUN.Abp.Identity |
||||
namespace LINGYUN.Abp.Identity |
{ |
||||
{ |
public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateOrUpdateDto |
||||
public class IdentityUserClaimUpdateDto : IdentityUserClaimCreateDto |
{ |
||||
{ |
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
||||
[Required] |
public string NewClaimValue { get; set; } |
||||
[DynamicMaxLength(typeof(IdentityUserClaimConsts), nameof(IdentityUserClaimConsts.MaxClaimValueLength))] |
} |
||||
public string NewClaimValue { get; set; } |
} |
||||
} |
|
||||
} |
|
||||
|
|||||
@ -1,30 +1,36 @@ |
|||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp.Application.Services; |
using Volo.Abp.Application.Services; |
||||
|
|
||||
namespace LINGYUN.Abp.Identity |
namespace LINGYUN.Abp.Identity |
||||
{ |
{ |
||||
public interface IMyProfileAppService : IApplicationService |
public interface IMyProfileAppService : IApplicationService |
||||
{ |
{ |
||||
/// <summary>
|
/// <summary>
|
||||
/// 改变二次认证
|
/// 设置声明
|
||||
/// </summary>
|
/// </summary>
|
||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
/// <returns></returns>
|
||||
Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input); |
Task SetClaimAsync(IdentityUserClaimSetDto input); |
||||
/// <summary>
|
/// <summary>
|
||||
/// 发送改变手机号验证码
|
/// 改变二次认证
|
||||
/// </summary>
|
/// </summary>
|
||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
/// <returns></returns>
|
||||
Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input); |
Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input); |
||||
/// <summary>
|
/// <summary>
|
||||
/// 改变手机绑定
|
/// 发送改变手机号验证码
|
||||
/// </summary>
|
/// </summary>
|
||||
/// <param name="input"></param>
|
/// <param name="input"></param>
|
||||
/// <returns></returns>
|
/// <returns></returns>
|
||||
/// <remarks>
|
Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input); |
||||
/// 需二次认证,主要是为了无法用到重定向页面修改相关信息的地方(点名微信小程序)
|
/// <summary>
|
||||
/// </remarks>
|
/// 改变手机绑定
|
||||
Task ChangePhoneNumberAsync(ChangePhoneNumberDto input); |
/// </summary>
|
||||
} |
/// <param name="input"></param>
|
||||
} |
/// <returns></returns>
|
||||
|
/// <remarks>
|
||||
|
/// 需二次认证,主要是为了无法用到重定向页面修改相关信息的地方(点名微信小程序)
|
||||
|
/// </remarks>
|
||||
|
Task ChangePhoneNumberAsync(ChangePhoneNumberDto input); |
||||
|
} |
||||
|
} |
||||
|
|||||
@ -1,44 +1,52 @@ |
|||||
using Microsoft.AspNetCore.Mvc; |
using Microsoft.AspNetCore.Mvc; |
||||
using System.Threading.Tasks; |
using System.Threading.Tasks; |
||||
using Volo.Abp; |
using Volo.Abp; |
||||
using Volo.Abp.AspNetCore.Mvc; |
using Volo.Abp.AspNetCore.Mvc; |
||||
using Volo.Abp.Identity; |
using Volo.Abp.Identity; |
||||
|
|
||||
namespace LINGYUN.Abp.Identity |
namespace LINGYUN.Abp.Identity |
||||
{ |
{ |
||||
[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] |
[RemoteService(Name = IdentityRemoteServiceConsts.RemoteServiceName)] |
||||
[Area("identity")] |
[Area("identity")] |
||||
[ControllerName("Profile")] |
[ControllerName("Profile")] |
||||
[Route("/api/identity/my-profile")] |
[Route("/api/identity/my-profile")] |
||||
public class MyProfileController : AbpController, IMyProfileAppService |
public class MyProfileController : AbpController, IMyProfileAppService |
||||
{ |
{ |
||||
protected IMyProfileAppService MyProfileAppService { get; } |
protected IMyProfileAppService MyProfileAppService { get; } |
||||
|
|
||||
public MyProfileController( |
public MyProfileController( |
||||
IMyProfileAppService myProfileAppService) |
IMyProfileAppService myProfileAppService) |
||||
{ |
{ |
||||
MyProfileAppService = myProfileAppService; |
MyProfileAppService = myProfileAppService; |
||||
} |
} |
||||
|
|
||||
[HttpPut] |
[HttpPut] |
||||
[Route("change-two-factor")] |
[Route("/claims")] |
||||
public virtual async Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input) |
public virtual async Task SetClaimAsync(IdentityUserClaimSetDto input) |
||||
{ |
{ |
||||
await MyProfileAppService.ChangeTwoFactorEnabledAsync(input); |
await MyProfileAppService.SetClaimAsync(input); |
||||
} |
} |
||||
|
|
||||
[HttpPut] |
|
||||
[Route("send-phone-number-change-code")] |
[HttpPut] |
||||
public virtual async Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input) |
[Route("change-two-factor")] |
||||
{ |
public virtual async Task ChangeTwoFactorEnabledAsync(ChangeTwoFactorEnabledDto input) |
||||
await MyProfileAppService.SendChangePhoneNumberCodeAsync(input); |
{ |
||||
} |
await MyProfileAppService.ChangeTwoFactorEnabledAsync(input); |
||||
|
} |
||||
[HttpPut] |
|
||||
[Route("change-phone-number")] |
[HttpPut] |
||||
public virtual async Task ChangePhoneNumberAsync(ChangePhoneNumberDto input) |
[Route("send-phone-number-change-code")] |
||||
{ |
public virtual async Task SendChangePhoneNumberCodeAsync(SendChangePhoneNumberCodeDto input) |
||||
await MyProfileAppService.ChangePhoneNumberAsync(input); |
{ |
||||
} |
await MyProfileAppService.SendChangePhoneNumberCodeAsync(input); |
||||
} |
} |
||||
} |
|
||||
|
[HttpPut] |
||||
|
[Route("change-phone-number")] |
||||
|
public virtual async Task ChangePhoneNumberAsync(ChangePhoneNumberDto input) |
||||
|
{ |
||||
|
await MyProfileAppService.ChangePhoneNumberAsync(input); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|||||
Loading…
Reference in new issue