From af0e0a110e7187bf008655f7510199a0c0b25ec4 Mon Sep 17 00:00:00 2001 From: Nymph2333 <498092988@qq.com> Date: 星期一, 10 四月 2023 14:27:40 +0800 Subject: [PATCH] newInstance() 已弃用,使用clazz.getDeclaredConstructor().newInstance() This method propagates any exception thrown by the nullary constructor, including a checked exception. Use of this method effectively bypasses the compile-time exception checking that would otherwise be performed by the compiler. The Constructor.newInstance method avoids this problem by wrapping any exception thrown by the constructor in a (checked) InvocationTargetException. The call clazz.newInstance() can be replaced by clazz.getDeclaredConstructor().newInstance() The latter sequence of calls is inferred to be able to throw the additional exception types InvocationTargetException and NoSuchMethodException. Both of these exception types are subclasses of ReflectiveOperationException. --- ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java | 64 ++++++++++++++++++-------------- 1 files changed, 36 insertions(+), 28 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java index 1e9a995..f4ba293 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java @@ -1,5 +1,7 @@ package com.ruoyi.common.constant; +import io.jsonwebtoken.Claims; + /** * 通用常量信息 * @@ -16,6 +18,11 @@ * GBK 字符集 */ public static final String GBK = "GBK"; + + /** + * www主域 + */ + public static final String WWW = "www."; /** * http请求 @@ -48,25 +55,15 @@ public static final String LOGOUT = "Logout"; /** + * 注册 + */ + public static final String REGISTER = "Register"; + + /** * 登录失败 */ public static final String LOGIN_FAIL = "Error"; - - /** - * 验证码 redis key - */ - public static final String CAPTCHA_CODE_KEY = "captcha_codes:"; - - /** - * 登录用户 redis key - */ - public static final String LOGIN_TOKEN_KEY = "login_tokens:"; - - /** - * 防重提交 redis key - */ - public static final String REPEAT_SUBMIT_KEY = "repeat_submit:"; - + /** * 验证码有效期(分钟) */ @@ -95,7 +92,7 @@ /** * 用户名称 */ - public static final String JWT_USERNAME = "sub"; + public static final String JWT_USERNAME = Claims.SUBJECT; /** * 用户头像 @@ -113,16 +110,6 @@ public static final String JWT_AUTHORITIES = "authorities"; /** - * 参数管理 cache key - */ - public static final String SYS_CONFIG_KEY = "sys_config:"; - - /** - * 字典管理 cache key - */ - public static final String SYS_DICT_KEY = "sys_dict:"; - - /** * 资源映射路径 前缀 */ public static final String RESOURCE_PREFIX = "/profile"; @@ -130,5 +117,26 @@ /** * RMI 远程方法调用 */ - public static final String LOOKUP_RMI = "rmi://"; + public static final String LOOKUP_RMI = "rmi:"; + + /** + * LDAP 远程方法调用 + */ + public static final String LOOKUP_LDAP = "ldap:"; + + /** + * LDAPS 远程方法调用 + */ + public static final String LOOKUP_LDAPS = "ldaps:"; + + /** + * 定时任务白名单配置(仅允许访问的包名,如其他需要可以自行添加) + */ + public static final String[] JOB_WHITELIST_STR = { "com.ruoyi" }; + + /** + * 定时任务违规的字符 + */ + public static final String[] JOB_ERROR_STR = { "java.net.URL", "javax.naming.InitialContext", "org.yaml.snakeyaml", + "org.springframework", "org.apache", "com.ruoyi.common.utils.file", "com.ruoyi.common.config" }; } -- Gitblit v1.9.2