Constants.java 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. package com.zhongzheng.common.constant;
  2. /**
  3. * 通用常量信息
  4. *
  5. * @author zhongzheng
  6. */
  7. public class Constants
  8. {
  9. /**
  10. * UTF-8 字符集
  11. */
  12. public static final String UTF8 = "UTF-8";
  13. /**
  14. * GBK 字符集
  15. */
  16. public static final String GBK = "GBK";
  17. /**
  18. * http请求
  19. */
  20. public static final String HTTP = "http://";
  21. /**
  22. * https请求
  23. */
  24. public static final String HTTPS = "https://";
  25. /**
  26. * 通用成功标识
  27. */
  28. public static final String SUCCESS = "0";
  29. /**
  30. * 通用失败标识
  31. */
  32. public static final String FAIL = "1";
  33. /**
  34. * 登录成功
  35. */
  36. public static final String LOGIN_SUCCESS = "Success";
  37. /**
  38. * 注销
  39. */
  40. public static final String LOGOUT = "Logout";
  41. /**
  42. * 登录失败
  43. */
  44. public static final String LOGIN_FAIL = "Error";
  45. /**
  46. * 验证码 redis key
  47. */
  48. public static final String CAPTCHA_CODE_KEY = "captcha_codes:";
  49. /**
  50. * 登录用户 redis key
  51. */
  52. public static final String LOGIN_TOKEN_KEY = "login_tokens:";
  53. public static final String WX_LOGIN_TOKEN_KEY = "wx_login_tokens:";
  54. /**
  55. * 防重提交 redis key
  56. */
  57. public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";
  58. /**
  59. * 验证码有效期(分钟)
  60. */
  61. public static final Integer CAPTCHA_EXPIRATION = 2;
  62. /**
  63. * 令牌
  64. */
  65. public static final String TOKEN = "token";
  66. /**
  67. * 令牌前缀
  68. */
  69. public static final String TOKEN_PREFIX = "Bearer ";
  70. /**
  71. * 超级管理员令牌前缀
  72. */
  73. public static final String SUPER_TOKEN_PREFIX = "BearerSuper ";
  74. /**
  75. * 微信令牌前缀
  76. */
  77. public static final String WX_TOKEN_PREFIX = "WX ";
  78. public static final String REGISTER_SMS = "REGISTER-";
  79. public static final String FORGET_SMS = "FORGET-";
  80. public static final String LOGIN_SMS = "LOGIN-";
  81. //默认头像
  82. public static final String DEFAULT_AVATAR = "oss/images/avatar/20210623/1624414559368_44562477.png";
  83. /**
  84. * 令牌前缀
  85. */
  86. public static final String LOGIN_USER_KEY = "login_user_key";
  87. public static final String WX_LOGIN_USER_KEY = "wx_login_user_key";
  88. public static final String SELLER_LOGIN_USER_KEY = "seller_login_user_key";
  89. /**
  90. * 用户ID
  91. */
  92. public static final String JWT_USERID = "userid";
  93. /**
  94. * 用户名称
  95. */
  96. public static final String JWT_USERNAME = "sub";
  97. /**
  98. * 用户头像
  99. */
  100. public static final String JWT_AVATAR = "avatar";
  101. /**
  102. * 创建时间
  103. */
  104. public static final String JWT_CREATED = "created";
  105. /**
  106. * 用户权限
  107. */
  108. public static final String JWT_AUTHORITIES = "authorities";
  109. /**
  110. * 参数管理 cache key
  111. */
  112. public static final String SYS_CONFIG_KEY = "sys_config:";
  113. /**
  114. * 字典管理 cache key
  115. */
  116. public static final String SYS_DICT_KEY = "sys_dict:";
  117. /**
  118. * 资源映射路径 前缀
  119. */
  120. public static final String RESOURCE_PREFIX = "/profile";
  121. }