| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- using System.Collections.Generic;
- using Abp.Application.Services.Dto;
- using Abp.AutoMapper;
- using WeApp.Authorization.Users;
- using IwbZero.Runtime.Session;
- namespace WeApp.BaseSystem.Sessions.Dto
- {
- [AutoMapFrom(typeof(User))]
- public class UserLoginInfoDto : EntityDto<long>
- {
- public string Name { get; set; }
- public string Surname { get; set; }
- public string UserName { get; set; }
- public string EmailAddress { get; set; }
- public string AvatarImagePath { get; set; }
- public int? AccountType { get; set; }
- public string AccountNo { get; set; }
- public int? UserType { get; set; }
- public List<string> UserRoles { get; set; }
- public List<string> UserRoleIds { get; set; }
- }
- public static class UserLoginInfoDtoExtensions
- {
- public static UserLoginInfoDto GetCurrentUser(this IIwbSession abpSession)
- {
- if (!abpSession.UserId.HasValue)
- {
- return null;
- }
- var dto = new UserLoginInfoDto()
- {
- Name = abpSession.RealName,
- UserName = abpSession.UserName,
- EmailAddress = abpSession.EmailAddress,
- AvatarImagePath = abpSession.AvatarImagePath,
- UserType = abpSession.UserType,
- AccountType = abpSession.AccountType,
- AccountNo = abpSession.AccountNo,
- UserRoles = abpSession.UserRoles,
- UserRoleIds = abpSession.UserRoleIds,
- };
- return dto;
- }
- }
- }
|