SecurityConfig.cs 1.4 KB

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