Browse Source

用户

bjmzak
wxd 2 years ago
parent
commit
c61812996a
  1. 7
      src/Shentun.Peis.Application/AbpUserDepartments/AbpUserDepartmentAppService.cs
  2. 2
      src/Shentun.Peis.Application/ItemTypes/ItemTypeAppService.cs
  3. 9
      src/Shentun.Peis.Application/MyUser/MyUserAppService.cs

7
src/Shentun.Peis.Application/AbpUserDepartments/AbpUserDepartmentAppService.cs

@ -40,13 +40,17 @@ namespace Shentun.Peis.AbpUserDepartments
public async Task CreateManyAsync(Guid UserId, List<Guid> OrganizationUnitIds)
{
if (UserId == Guid.Empty || !OrganizationUnitIds.Any())
if (UserId == Guid.Empty)
{
throw new UserFriendlyException($"请求参数有误");
}
await _abpUserDepartmentRepository.DeleteAsync(d => d.UserId == UserId, true);
if (OrganizationUnitIds.Any())
{
List<AbpUserDepartment> entlist = new List<AbpUserDepartment>();
foreach (var org in OrganizationUnitIds)
{
@ -60,6 +64,7 @@ namespace Shentun.Peis.AbpUserDepartments
await _abpUserDepartmentRepository.InsertManyAsync(entlist, true);
}
}
/// <summary>

2
src/Shentun.Peis.Application/ItemTypes/ItemTypeAppService.cs

@ -111,7 +111,7 @@ namespace Shentun.Peis.ItemTypes
public async Task<List<TreeChildViewDto>> GetByCodeAllAsync()
{
var dataList = await Repository.GetListAsync();
var items = from p in dataList
var items = from p in dataList.OrderBy(o => o.DisplayOrder)
select new TreeChildViewDto()
{
Id = p.Id,

9
src/Shentun.Peis.Application/MyUser/MyUserAppService.cs

@ -355,6 +355,15 @@ namespace Shentun.Peis.MyUser
var organizationUnitList = await _organizationUnitRepository.GetListAsync();
var PeisId = await _peisOrganizationUnitManager.GetPeisIdAsync(organizationUnitList, user.Id);
if (user.IsActive == false)
{
throw new UserFriendlyException("账号已被禁用");
}
if (user.LockoutEnabled == true)
{
throw new UserFriendlyException("账号已被锁定");
}
TokenResponse token = await RequestAuthServerLoginByPasswordAsync(input.UserName, input.PassWord);

Loading…
Cancel
Save