SecurityConfig.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. namespace ERP.Framework.Config
  2. {
  3. public class SecurityConfig
  4. {
  5. #region 密码错误
  6. /// <summary>
  7. /// 最大输入密码错误
  8. /// </summary>
  9. public int MaxRetryCount { get; set; } = 5;
  10. /// <summary>
  11. /// 密码错误锁定时间 (单位:s , 默认10分钟)
  12. /// </summary>
  13. public int LockTime { get; set; } = 10 * 60;
  14. #endregion 密码错误
  15. /// <summary>
  16. /// JWT 密匙
  17. /// </summary>
  18. public string JwtSecurityKey { get; set; } = "ma8v4HqAEMOFTWY6sF013isL6wYiczX1Na5mTQLdB3bKXpyRhRSn3iStepOUSvmI";
  19. /// <summary>
  20. /// Token 对应的 Redis 存储时间(单位:分钟 ,默认1天)
  21. /// </summary>
  22. public int TimeOut { get; set; } = 60 * 24;
  23. /// <summary>
  24. /// Token临时有效期 [指定时间内无操作就视为token过期] (单位: 分钟), 默认30分钟
  25. /// </summary>
  26. public int ActivityTimeOut { get; set; } = 30;
  27. /// <summary>
  28. /// 一个设备只允许一个账号登录
  29. /// </summary>
  30. public bool UseDeviceKey { get; set; } = false;
  31. /// <summary>
  32. /// 同一账号,最大登录数量,-1代表不限
  33. /// </summary>
  34. public int MaxLoginCount { get; set; } = 5;
  35. public List<string>? WhiteList { get; set; }
  36. }
  37. }