| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- using System.ComponentModel.DataAnnotations;
- using System.ComponentModel.DataAnnotations.Schema;
- using Abp.Domain.Entities;
- using Abp.Domain.Entities.Auditing;
- using Abp.Timing;
- using VberZero.Authorization;
- using VberZero.BaseSystem.MultiTenancy;
- namespace VberZero.BaseSystem.Users;
- /// <summary>
- /// 存储用户的登录尝试
- /// </summary>
- [Table("Sys_UserLoginAttempts")]
- public class UserLoginAttempt : Entity<long>, IHasCreationTime, IMayHaveTenant
- {
- public const int MaxTenancyNameLength = Tenant.MaxTenancyNameLength;
- public const int MaxUserNameOrEmailAddressLength = User.MaxEmailAddressLength;
- public const int MaxClientIpAddressLength = 64;
- public const int MaxClientNameLength = 128;
- public const int MaxBrowserInfoLength = 512;
- /// <summary>
- /// 租户的 ID,如果 <see cref="TenancyName"/> 是有效的租户名称。
- /// </summary>
- public virtual int? TenantId { get; set; }
- [StringLength(MaxTenancyNameLength)]
- public virtual string TenancyName { get; set; }
- /// <summary>
- /// 用户 ID,如果 <see cref="UserNameOrEmailOrPhone"/> 是有效的用户名或电子邮件或手机号
- /// </summary>
- public virtual long? UserId { get; set; }
- [StringLength(MaxUserNameOrEmailAddressLength)]
- public virtual string UserNameOrEmailOrPhone { get; set; }
- /// <summary>
- /// 客户端的 IP 地址
- /// </summary>
- [StringLength(MaxClientIpAddressLength)]
- public virtual string ClientIpAddress { get; set; }
- /// <summary>
- /// 客户端的名称(一般为计算机名称)
- /// </summary>
- [StringLength(MaxClientNameLength)]
- public virtual string ClientName { get; set; }
- /// <summary>
- /// 如果在 Web 请求中调用此方法,则浏览器信息。
- /// </summary>
- [StringLength(MaxBrowserInfoLength)]
- public virtual string BrowserInfo { get; set; }
- /// <summary>
- /// 登录尝试结果
- /// </summary>
- public virtual VzLoginResultType Result { get; set; }
- public virtual DateTime CreationTime { get; set; }
- public UserLoginAttempt()
- {
- CreationTime = Clock.Now;
- }
- }
|