Constants.java 3.6 KB

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