Browse Source

feat(identity): optimize identity session query

- Replace the SQL query with the current user Id
pull/1272/head
colin 7 months ago
parent
commit
32085e4e85
  1. 6
      aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs

6
aspnet-core/modules/account/LINGYUN.Abp.Account.Application/LINGYUN/Abp/Account/MyProfileAppService.cs

@ -75,12 +75,12 @@ public class MyProfileAppService : AccountApplicationServiceBase, IMyProfileAppS
public async virtual Task<PagedResultDto<IdentitySessionDto>> GetSessionsAsync(GetMySessionsInput input)
{
var user = await GetCurrentUserAsync();
var userId = CurrentUser.GetId();
var totalCount = await IdentitySessionRepository.GetCountAsync(
user.Id, input.Device, input.ClientId);
userId, input.Device, input.ClientId);
var identitySessions = await IdentitySessionRepository.GetListAsync(
input.Sorting, input.MaxResultCount, input.SkipCount,
user.Id, input.Device, input.ClientId);
userId, input.Device, input.ClientId);
return new PagedResultDto<IdentitySessionDto>(totalCount,
identitySessions.Select(session => new IdentitySessionDto

Loading…
Cancel
Save