Constants.java 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. package com.ruoyi.common.constant;
  2. /**
  3. * 通用常量信息
  4. *
  5. * @author ruoyi
  6. */
  7. public class Constants {
  8. /**
  9. * UTF-8 字符集
  10. */
  11. public static final String UTF8 = "UTF-8";
  12. /**
  13. * GBK 字符集
  14. */
  15. public static final String GBK = "GBK";
  16. /**
  17. * http请求
  18. */
  19. public static final String HTTP = "http://";
  20. /**
  21. * https请求
  22. */
  23. public static final String HTTPS = "https://";
  24. /**
  25. * 通用成功标识
  26. */
  27. public static final String SUCCESS = "0";
  28. /**
  29. * 通用失败标识
  30. */
  31. public static final String FAIL = "1";
  32. /**
  33. * 登录成功
  34. */
  35. public static final String LOGIN_SUCCESS = "Success";
  36. /**
  37. * 注销
  38. */
  39. public static final String LOGOUT = "Logout";
  40. /**
  41. * 注册
  42. */
  43. public static final String REGISTER = "Register";
  44. /**
  45. * 登录失败
  46. */
  47. public static final String LOGIN_FAIL = "Error";
  48. /**
  49. * 验证码 redis key
  50. */
  51. public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
  52. /**
  53. * 登录用户 redis key
  54. */
  55. public static final String LOGIN_TOKEN_KEY = "Authorization:login:token:";
  56. /**
  57. * 在线用户 redis key
  58. */
  59. public static final String ONLINE_TOKEN_KEY = "online_tokens:";
  60. /**
  61. * 防重提交 redis key
  62. */
  63. public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
  64. /**
  65. * 限流 redis key
  66. */
  67. public static final String RATE_LIMIT_KEY = "rate_limit:";
  68. /**
  69. * 验证码有效期(分钟)
  70. */
  71. public static final Integer CAPTCHA_EXPIRATION = 2;
  72. /**
  73. * 令牌
  74. */
  75. public static final String TOKEN = "token";
  76. /**
  77. * 令牌前缀
  78. */
  79. public static final String LOGIN_USER_KEY = "login_user_key";
  80. /**
  81. * 参数管理 cache key
  82. */
  83. public static final String SYS_CONFIG_KEY = "sys_config:";
  84. /**
  85. * 字典管理 cache key
  86. */
  87. public static final String SYS_DICT_KEY = "sys_dict:";
  88. }