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