feat: 完成支持微信扫码功能
This commit is contained in:
@@ -36,6 +36,11 @@
|
||||
/// 昵称
|
||||
/// </summary>
|
||||
public string? Nick{ get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 头像
|
||||
/// </summary>
|
||||
public string? Icon { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,6 +38,6 @@ namespace Yi.Framework.Rbac.Application.Contracts.IServices
|
||||
/// 不需要验证,为了给第三方使用,例如微信小程序,后续可通过绑定操作,进行账号合并
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
Task PostTempRegisterAsync(RegisterDto input);
|
||||
Task<Guid> PostSystemRegisterAsync(RegisterDto input);
|
||||
}
|
||||
}
|
||||
@@ -246,20 +246,21 @@ namespace Yi.Framework.Rbac.Application.Services
|
||||
|
||||
//注册之后,免再次登录,直接给前端token
|
||||
var userId = await _accountManager.RegisterAsync(input.UserName, input.Password, input.Phone, input.Email,
|
||||
input.Nick);
|
||||
input.Nick, null);
|
||||
return await this.PostLoginAsync(userId);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 临时注册
|
||||
/// 系统直接注册用户
|
||||
/// 不需要验证,为了给第三方使用,例如微信小程序,后续可通过绑定操作,进行账号合并
|
||||
/// </summary>
|
||||
/// <param name="input"></param>
|
||||
[RemoteService(isEnabled: false)]
|
||||
public async Task PostTempRegisterAsync(RegisterDto input)
|
||||
public async Task<Guid> PostSystemRegisterAsync(RegisterDto input)
|
||||
{
|
||||
//注册领域逻辑
|
||||
await _accountManager.RegisterAsync(input.UserName, input.Password, input.Phone, input.Email, input.Nick);
|
||||
return await _accountManager.RegisterAsync(input.UserName, input.Password, input.Phone, input.Email,
|
||||
input.Nick, input.Icon);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -19,12 +19,14 @@ namespace Yi.Framework.Rbac.Domain.Entities
|
||||
{
|
||||
}
|
||||
|
||||
public UserAggregateRoot(string userName, string password, long? phone, string? email, string? nick = null)
|
||||
public UserAggregateRoot(string userName, string password, long? phone, string? email, string? nick = null,
|
||||
string? icon = null)
|
||||
{
|
||||
UserName = userName;
|
||||
EncryPassword.Password = password;
|
||||
Phone = phone;
|
||||
Email = email;
|
||||
Icon = icon;
|
||||
Nick = string.IsNullOrWhiteSpace(nick) ? "萌新-" + userName : nick.Trim();
|
||||
BuildPassword();
|
||||
}
|
||||
|
||||
@@ -285,9 +285,10 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
/// <param name="phone"></param>
|
||||
/// <param name="email"></param>
|
||||
/// <param name="nick"></param>
|
||||
/// <param name="icon"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<Guid> RegisterAsync(string userName, string password, long? phone, string? email,
|
||||
string? nick)
|
||||
string? nick,string? icon)
|
||||
{
|
||||
if (phone is null && string.IsNullOrWhiteSpace(email))
|
||||
{
|
||||
|
||||
@@ -14,7 +14,8 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
string CreateRefreshToken(Guid userId);
|
||||
Task<string> GetTokenByUserIdAsync(Guid userId,Action<UserRoleMenuDto>? getUserInfo=null);
|
||||
Task LoginValidationAsync(string userName, string password, Action<UserAggregateRoot>? userAction = null);
|
||||
Task<Guid> RegisterAsync(string userName, string password, long? phone, string? email, string? nick);
|
||||
Task<Guid> RegisterAsync(string userName, string password, long? phone, string? email, string? nick,
|
||||
string? icon);
|
||||
Task<bool> RestPasswordAsync(Guid userId, string password);
|
||||
Task UpdatePasswordAsync(Guid userId, string newPassword, string oldPassword);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user