feat: 添加值对象
This commit is contained in:
@@ -154,7 +154,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
{
|
||||
userAction.Invoke(user);
|
||||
}
|
||||
if (user.Password == MD5Helper.SHA2Encode(password, user.Salt))
|
||||
if (user.EncryPassword.Password == MD5Helper.SHA2Encode(password, user.EncryPassword.Salt))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -247,7 +247,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
{
|
||||
throw new UserFriendlyException("无效更新!原密码错误!");
|
||||
}
|
||||
user.Password = newPassword;
|
||||
user.EncryPassword.Password = newPassword;
|
||||
user.BuildPassword();
|
||||
await _repository.UpdateAsync(user);
|
||||
}
|
||||
@@ -262,7 +262,7 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
{
|
||||
var user = await _repository.GetByIdAsync(userId);
|
||||
// EntityHelper.TrySetId(user, () => GuidGenerator.Create(), true);
|
||||
user.Password = password;
|
||||
user.EncryPassword.Password = password;
|
||||
user.BuildPassword();
|
||||
return await _repository.UpdateAsync(user);
|
||||
}
|
||||
|
||||
@@ -152,8 +152,8 @@ namespace Yi.Framework.Rbac.Domain.Managers
|
||||
//{
|
||||
// throw new UserFriendlyException($"数据错误,用户id:{nameof(userId)} 不存在,请重新登录");
|
||||
//}
|
||||
user.Password = string.Empty;
|
||||
user.Salt = string.Empty;
|
||||
user.EncryPassword.Password = string.Empty;
|
||||
user.EncryPassword.Salt = string.Empty;
|
||||
|
||||
//超级管理员特殊处理
|
||||
if (UserConst.Admin.Equals(user.UserName))
|
||||
|
||||
Reference in New Issue
Block a user