SessionAppService.cs 838 B

12345678910111213141516171819202122232425262728
  1. using System.Threading.Tasks;
  2. using Abp.Auditing;
  3. using WePlatform.BaseSystem.Sessions.Dto;
  4. using WePlatform.Configuration;
  5. namespace WePlatform.BaseSystem.Sessions
  6. {
  7. public class SessionAppService : IwbAppServiceBase, ISessionAppService
  8. {
  9. [DisableAuditing]
  10. public async Task<GetCurrentLoginInformationsOutput> GetCurrentLoginInformations()
  11. {
  12. var output = new GetCurrentLoginInformationsOutput();
  13. if (AbpSession.UserId.HasValue)
  14. {
  15. output.User = ObjectMapper.Map<UserLoginInfoDto>((await GetCurrentUserAsync()));
  16. }
  17. if (AbpSession.TenantId.HasValue)
  18. {
  19. output.Tenant = ObjectMapper.Map<TenantLoginInfoDto>((await GetCurrentTenantAsync()));
  20. }
  21. return output;
  22. }
  23. }
  24. }