TokenModel.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. namespace Model.Base
  2. {
  3. public class TokenModel
  4. {
  5. public long UserId { get; set; }
  6. public long DeptId { get; set; }
  7. public string Username { get; set; }
  8. /// <summary>
  9. /// 角色集合
  10. /// </summary>
  11. public List<string> RoleIds { get; set; }
  12. /// <summary>
  13. /// 角色集合(数据权限过滤使用)
  14. /// </summary>
  15. public List<Roles> Roles { get; set; }
  16. /// <summary>
  17. /// Jwt过期时间
  18. /// </summary>
  19. public DateTime ExpireTime { get; set; }
  20. /// <summary>
  21. /// 权限集合
  22. /// </summary>
  23. //public List<string> Permissions { get; set; } = new List<string>();
  24. public TokenModel()
  25. {
  26. }
  27. public TokenModel(TokenModel info, List<Roles> roles)
  28. {
  29. UserId = info.UserId;
  30. Username = info.Username;
  31. DeptId = info.DeptId;
  32. Roles = roles;
  33. RoleIds = roles.Select(f => f.RoleKey).ToList();
  34. }
  35. }
  36. public class Roles
  37. {
  38. public long RoleId { get; set; }
  39. public string RoleKey { get; set; }
  40. public int DataScope { get; set; }
  41. }
  42. }