重置密码功能

This commit is contained in:
chenchun
2022-09-11 13:16:24 +08:00
parent 0cd3bea6bd
commit 909bdf60e7
5 changed files with 31 additions and 3 deletions

View File

@@ -235,5 +235,17 @@ namespace Yi.Framework.Service
var res2 = await GiveUserSetRole(new List<long> { res1 }, userDto.RoleIds);
return !0.Equals(res1) && res2;
}
public async Task<bool> RestPassword(long userId, string password)
{
var user = new UserEntity();
user.Id = userId;
user.Password = password;
user.BuildPassword();
return await _repository.UpdateIgnoreNullAsync(user);
}
}
}