Constants.java 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. package com.shanghaichengdi.ghjgitem.constant;
  2. import io.jsonwebtoken.Claims;
  3. import java.util.Locale;
  4. /**
  5. * 通用常量信息
  6. *
  7. * @author ruoyi
  8. */
  9. public class Constants {
  10. /**
  11. * UTF-8 字符集
  12. */
  13. public static final String UTF8 = "UTF-8";
  14. /**
  15. * GBK 字符集
  16. */
  17. public static final String GBK = "GBK";
  18. /**
  19. * 系统语言
  20. */
  21. public static final Locale DEFAULT_LOCALE = Locale.SIMPLIFIED_CHINESE;
  22. /**
  23. * www主域
  24. */
  25. public static final String WWW = "www.";
  26. /**
  27. * http请求
  28. */
  29. public static final String HTTP = "http://";
  30. /**
  31. * https请求
  32. */
  33. public static final String HTTPS = "https://";
  34. /**
  35. * 通用成功标识
  36. */
  37. public static final String SUCCESS = "0";
  38. /**
  39. * 通用失败标识
  40. */
  41. public static final String FAIL = "1";
  42. /**
  43. * 登录成功
  44. */
  45. public static final String LOGIN_SUCCESS = "Success";
  46. /**
  47. * 注销
  48. */
  49. public static final String LOGOUT = "Logout";
  50. /**
  51. * 注册
  52. */
  53. public static final String REGISTER = "Register";
  54. /**
  55. * 登录失败
  56. */
  57. public static final String LOGIN_FAIL = "Error";
  58. /**
  59. * 所有权限标识
  60. */
  61. public static final String ALL_PERMISSION = "*:*:*";
  62. /**
  63. * 管理员角色权限标识
  64. */
  65. public static final String SUPER_ADMIN = "admin";
  66. /**
  67. * 角色权限分隔符
  68. */
  69. public static final String ROLE_DELIMETER = ",";
  70. /**
  71. * 权限标识分隔符
  72. */
  73. public static final String PERMISSION_DELIMETER = ",";
  74. /**
  75. * 验证码有效期(分钟)
  76. */
  77. public static final Integer CAPTCHA_EXPIRATION = 2;
  78. /**
  79. * 令牌
  80. */
  81. public static final String TOKEN = "token";
  82. /**
  83. * redis分隔符
  84. */
  85. public static final String SPLIT = ":";
  86. /**
  87. * 令牌前缀
  88. */
  89. public static final String TOKEN_PREFIX = "Bearer ";
  90. /**
  91. * 令牌前缀
  92. */
  93. public static final String LOGIN_USER_KEY = "login_user_key";
  94. /**
  95. * 用户ID
  96. */
  97. public static final String JWT_USERID = "userid";
  98. /**
  99. * 用户名称
  100. */
  101. public static final String JWT_USERNAME = Claims.SUBJECT;
  102. /**
  103. * 用户头像
  104. */
  105. public static final String JWT_AVATAR = "avatar";
  106. /**
  107. * 创建时间
  108. */
  109. public static final String JWT_CREATED = "created";
  110. /**
  111. * 用户权限
  112. */
  113. public static final String JWT_AUTHORITIES = "authorities";
  114. /**
  115. * 资源映射路径 前缀
  116. */
  117. public static final String RESOURCE_PREFIX = "/profile";
  118. /**
  119. * RMI 远程方法调用
  120. */
  121. public static final String LOOKUP_RMI = "rmi:";
  122. /**
  123. * LDAP 远程方法调用
  124. */
  125. public static final String LOOKUP_LDAP = "ldap:";
  126. /**
  127. * LDAPS 远程方法调用
  128. */
  129. public static final String LOOKUP_LDAPS = "ldaps:";
  130. /**
  131. * 自动识别json对象白名单配置(仅允许解析的包名,范围越小越安全)
  132. */
  133. public static final String[] JSON_WHITELIST_STR = {"org.springframework", "com.shcd"};
  134. /**
  135. * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加)
  136. */
  137. public static final String[] JOB_WHITELIST_STR = {"com.shcd.quartz.task"};
  138. /**
  139. * 定时任务违规的字符
  140. */
  141. public static final String[] JOB_ERROR_STR = {"java.net.URL", "javax.naming.InitialContext",
  142. "org.yaml.snakeyaml",
  143. "org.springframework", "org.apache", "com.shcd.common.utils.file", "com.shcd.common.config",
  144. "com.shcd.generator"};
  145. public static final String JWT_KEY = "ghDatashare";
  146. public static final String ENCODES_KEY = "ghThreeDataShare";
  147. }