diff --git a/jeecg-boot/db/版本升级说明.md b/jeecg-boot/db/版本升级说明.md index 20ae0be8..2bcc85e1 100644 --- a/jeecg-boot/db/版本升级说明.md +++ b/jeecg-boot/db/版本升级说明.md @@ -3,7 +3,6 @@ > JeecgBoot属于平台级产品,每次升级改动较大,目前做不到平滑升级。 ### 增量升级方案 - #### 1.代码合并 本地通过svn或git做好主干,在分支上做业务开发,jeecg每次版本发布,可以手工覆盖主干的代码,对比合并代码; @@ -12,12 +11,5 @@ - 其他库请手工执行SQL, 目录: `jeecg-module-system\jeecg-system-start\src\main\resources\flyway\sql\mysql` > 注意: 升级sql只提供mysql版本;如果有权限升级, 还需要手工角色授权,退出重新登录才好使。 -#### 3.其他数据库脚本说明 - 原先官方默认提供oracle和SqlServer的脚本,但是维护成本太高,未提供脚本的数据库,可以参考下面的文档自己转 - https://my.oschina.net/jeecg/blog/4905722 - (注意:定时任务的表qrtz_*,需要删掉用原始的脚本重新执行一下) - quartz-2.2.3-distribution.tar.gz放到百度网盘中,大家自己下载,执行所需数据库脚本 - https://pan.baidu.com/s/1WrmZdUuAPg3iBwJ-LoHWyg?pwd=8mdz - -#### 4.兼容问题 +#### 3.兼容问题 每次发版,会针对不兼容地方重点说明。 \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-base-core/pom.xml b/jeecg-boot/jeecg-boot-base-core/pom.xml index f3fef067..c4ae57e1 100644 --- a/jeecg-boot/jeecg-boot-base-core/pom.xml +++ b/jeecg-boot/jeecg-boot-base-core/pom.xml @@ -49,6 +49,16 @@ org.springframework.boot spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + org.springframework.boot + spring-boot-starter-undertow @@ -257,6 +267,12 @@ io.minio minio + + + checker-qual + org.checkerframework + + @@ -298,7 +314,6 @@ cn.hutool hutool-crypto - org.jeecgframework.boot diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootAssertException.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootAssertException.java new file mode 100644 index 00000000..b090ea1a --- /dev/null +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/exception/JeecgBootAssertException.java @@ -0,0 +1,21 @@ +package org.jeecg.common.exception; + +/** + * jeecgboot断言异常 + * for [QQYUN-10990]AIRAG + * @author chenrui + * @date 2025/2/14 14:31 + */ +public class JeecgBootAssertException extends JeecgBootException { + private static final long serialVersionUID = 1L; + + + public JeecgBootAssertException(String message) { + super(message); + } + + public JeecgBootAssertException(String message, int errCode) { + super(message, errCode); + } + +} diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java index 5b2d4129..c6fa09dd 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/system/util/JwtUtil.java @@ -6,6 +6,17 @@ import com.auth0.jwt.algorithms.Algorithm; import com.auth0.jwt.exceptions.JWTDecodeException; import com.auth0.jwt.interfaces.DecodedJWT; import com.fasterxml.jackson.databind.ObjectMapper; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Date; +import java.util.Objects; +import java.util.stream.Collectors; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + import lombok.extern.slf4j.Slf4j; import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; @@ -20,16 +31,6 @@ import org.jeecg.common.util.DateUtils; import org.jeecg.common.util.SpringContextUtils; import org.jeecg.common.util.oConvertUtils; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; -import java.io.IOException; -import java.io.OutputStream; -import java.util.Date; -import java.util.Objects; -import java.util.stream.Collectors; - /** * @Author Scott * @Date 2018-07-12 14:23 diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java new file mode 100644 index 00000000..ac502ea3 --- /dev/null +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/AssertUtils.java @@ -0,0 +1,239 @@ +package org.jeecg.common.util; + + +import org.jeecg.common.exception.JeecgBootAssertException; + +/** + * 断言检查工具 + * for for [QQYUN-10990]AIRAG + * @author chenrui + * @date 2017-06-22 10:05:56 + */ +public class AssertUtils { + + /** + * 确保对象为空,如果不为空抛出异常 + * + * @param msg + * @param obj + * @throws JeecgBootAssertException + * @author chenrui + * @date 2017-06-22 10:05:56 + */ + public static void assertEmpty(String msg, Object obj) { + if (oConvertUtils.isObjectNotEmpty(obj)) { + throw new JeecgBootAssertException(msg); + } + } + + + /** + * 确保对象不为空,如果为空抛出异常 + * + * @param msg + * @param obj + * @throws JeecgBootAssertException + * @author chenrui + * @date 2017-06-22 10:05:56 + */ + public static void assertNotEmpty(String msg, Object obj) { + if (oConvertUtils.isObjectEmpty(obj)) { + throw new JeecgBootAssertException(msg); + } + } + + + /** + * 验证对象是否相同 + * + * @param message + * @param expected + * @param actual + * @author chenrui + * @date 2018/9/12 15:45 + */ + public static void assertEquals(String message, Object expected, + Object actual) { + if (oConvertUtils.isEqual(expected, actual)) { + return; + } + throw new JeecgBootAssertException(message); + } + + /** + * 验证不相同 + * + * @param message + * @param expected + * @param actual + * @author chenrui + * @date 2018/9/12 15:45 + */ + public static void assertNotEquals(String message, Object expected, + Object actual) { + if (oConvertUtils.isEqual(expected, actual)) { + throw new JeecgBootAssertException(message); + } + + } + + /** + * 验证是否相等 + * + * @param message + * @param expected + * @param actual + * @author chenrui + * @date 2018/9/12 15:45 + */ + public static void assertSame(String message, Object expected, + Object actual) { + if (expected == actual) { + return; + } + throw new JeecgBootAssertException(message); + } + + /** + * 验证不相等 + * + * @param message + * @param unexpected + * @param actual + * @author chenrui + * @date 2018/9/12 15:45 + */ + public static void assertNotSame(String message, Object unexpected, + Object actual) { + if (unexpected == actual) { + throw new JeecgBootAssertException(message); + } + } + + /** + * 验证是否为真 + * + * @param message + * @param condition + */ + public static void assertTrue(String message, boolean condition) { + if (!condition) { + throw new JeecgBootAssertException(message); + } + } + + /** + * 验证 condition是否为false + * + * @param message + * @param condition + */ + public static void assertFalse(String message, boolean condition) { + assertTrue(message, !condition); + } + + + /** + * 验证是否存在 + * + * @param message + * @param obj + * @param objs + * @param + * @throws JeecgBootAssertException + * @author chenrui + * @date 2018/1/31 22:14 + */ + public static void assertIn(String message, T obj, T... objs) { + assertNotEmpty(message, obj); + assertNotEmpty(message, objs); + if (!oConvertUtils.isIn(obj, objs)) { + throw new JeecgBootAssertException(message); + } + } + + /** + * 验证是否不存在 + * + * @param message + * @param obj + * @param objs + * @param + * @throws JeecgBootAssertException + * @author chenrui + * @date 2018/1/31 22:14 + */ + + public static void assertNotIn(String message, T obj, T... objs) { + assertNotEmpty(message, obj); + assertNotEmpty(message, objs); + if (oConvertUtils.isIn(obj, objs)) { + throw new JeecgBootAssertException(message); + } + } + + + /** + * 确保src大于des + * + * @param message + * @param src + * @param des + * @author chenrui + * @date 2018/9/19 15:30 + */ + public static void assertGt(String message, Number src, Number des) { + if (oConvertUtils.isGt(src, des)) { + return; + } + throw new JeecgBootAssertException(message); + } + + /** + * 确保src大于等于des + * + * @param message + * @param src + * @param des + * @author chenrui + * @date 2018/9/19 15:30 + */ + public static void assertGe(String message, Number src, Number des) { + if (oConvertUtils.isGe(src, des)) { + return; + } + throw new JeecgBootAssertException(message); + } + + + /** + * 确保src小于des + * + * @param message + * @param src + * @param des + * @author chenrui + * @date 2018/9/19 15:30 + */ + public static void assertLt(String message, Number src, Number des) { + if (oConvertUtils.isGe(src, des)) { + throw new JeecgBootAssertException(message); + } + } + + /** + * 确保src小于等于des + * + * @param message + * @param src + * @param des + * @author chenrui + * @date 2018/9/19 15:30 + */ + public static void assertLe(String message, Number src, Number des) { + if (oConvertUtils.isGt(src, des)) { + throw new JeecgBootAssertException(message); + } + } + +} diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/filter/SsrfFileTypeFilter.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/filter/SsrfFileTypeFilter.java index 1a78fc54..ce3009b2 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/filter/SsrfFileTypeFilter.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/filter/SsrfFileTypeFilter.java @@ -42,6 +42,7 @@ public class SsrfFileTypeFilter { FILE_TYPE_WHITE_LIST.add("pdf"); FILE_TYPE_WHITE_LIST.add("csv"); // FILE_TYPE_WHITE_LIST.add("xml"); + FILE_TYPE_WHITE_LIST.add("md"); //音视频文件 FILE_TYPE_WHITE_LIST.add("mp4"); @@ -65,6 +66,10 @@ public class SsrfFileTypeFilter { FILE_TYPE_WHITE_LIST.add("apk"); FILE_TYPE_WHITE_LIST.add("wgt"); + //幻灯片文件后缀 + FILE_TYPE_WHITE_LIST.add("ppt"); + FILE_TYPE_WHITE_LIST.add("pptx"); + //设置禁止文件的头部标记 FILE_TYPE_MAP.put("3c25402070616765206c", "jsp"); FILE_TYPE_MAP.put("3c3f7068700a0a2f2a2a0a202a205048", "php"); diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java index 85741a23..11f16b7b 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/oConvertUtils.java @@ -13,6 +13,7 @@ import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.io.InputStream; import java.io.UnsupportedEncodingException; +import java.lang.reflect.Array; import java.lang.reflect.Field; import java.math.BigDecimal; import java.math.BigInteger; @@ -1028,5 +1029,109 @@ public class oConvertUtils { } return result; } + + /** + * 判断对象是否为空
+ * 支持各种类型的对象 + * for for [QQYUN-10990]AIRAG + * @param obj + * @return + * @author chenrui + * @date 2025/2/13 18:34 + */ + public static boolean isObjectEmpty(Object obj) { + if (null == obj) { + return true; + } + + if (obj instanceof CharSequence) { + return isEmpty(obj); + } else if (obj instanceof Map) { + return ((Map) obj).isEmpty(); + } else if (obj instanceof Iterable) { + return isObjectEmpty(((Iterable) obj).iterator()); + } else if (obj instanceof Iterator) { + return !((Iterator) obj).hasNext(); + } else if (isArray(obj)) { + return 0 == Array.getLength(obj); + } + return false; + } + + /** + * iterator 是否为空 + * for for [QQYUN-10990]AIRAG + * @param iterator Iterator对象 + * @return 是否为空 + */ + public static boolean isEmptyIterator(Iterator iterator) { + return null == iterator || false == iterator.hasNext(); + } + + + /** + * 判断对象是否不为空 + * for for [QQYUN-10990]AIRAG + * @param object + * @return + * @author chenrui + * @date 2025/2/13 18:35 + */ + public static boolean isObjectNotEmpty(Object object) { + return !isObjectEmpty(object); + } + + /** + * 如果src大于des返回true + * for [QQYUN-10990]AIRAG + * @param src + * @param des + * @return + * @author: chenrui + * @date: 2018/9/19 15:30 + */ + public static boolean isGt(Number src, Number des) { + if (null == src || null == des) { + throw new IllegalArgumentException("参数不能为空"); + } + if (src.doubleValue() > des.doubleValue()) { + return true; + } + return false; + } + + /** + * 如果src大于等于des返回true + * for [QQYUN-10990]AIRAG + * @param src + * @param des + * @return + * @author: chenrui + * @date: 2018/9/19 15:30 + */ + public static boolean isGe(Number src, Number des) { + if (null == src || null == des) { + throw new IllegalArgumentException("参数不能为空"); + } + if (src.doubleValue() < des.doubleValue()) { + return false; + } + return true; + } + + + /** + * 判断是否存在 + * for [QQYUN-10990]AIRAG + * @param obj + * @param objs + * @param + * @return + * @author chenrui + * @date 2020/9/12 15:50 + */ + public static boolean isIn(T obj, T... objs) { + return isIn(obj, objs); + } } diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/JeecgBaseConfig.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/JeecgBaseConfig.java index 52ab417a..0aac0e35 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/JeecgBaseConfig.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/JeecgBaseConfig.java @@ -17,6 +17,10 @@ public class JeecgBaseConfig { * @TODO 降低使用成本加的默认值,实际以 yml配置 为准 */ private String signatureSecret = "dd05f1c54d63749eda95f9fa6d49v442a"; + /** + * 自定义后台资源前缀,解决表单设计器无法通过前端nginx转发访问 + */ + private String customResourcePrefixPath; /** * 需要加强校验的接口清单 */ @@ -68,6 +72,14 @@ public class JeecgBaseConfig { */ private BaiduApi baiduApi; + public String getCustomResourcePrefixPath() { + return customResourcePrefixPath; + } + + public void setCustomResourcePrefixPath(String customResourcePrefixPath) { + this.customResourcePrefixPath = customResourcePrefixPath; + } + public Elasticsearch getElasticsearch() { return elasticsearch; } diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java index 92628df3..1fce8270 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/WebMvcConfiguration.java @@ -20,6 +20,7 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Conditional; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Primary; +import org.springframework.http.CacheControl; import org.springframework.http.converter.HttpMessageConverter; import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter; import org.springframework.web.cors.CorsConfiguration; @@ -37,6 +38,7 @@ import java.time.LocalDateTime; import java.time.LocalTime; import java.time.format.DateTimeFormatter; import java.util.List; +import java.util.concurrent.TimeUnit; /** * Spring Boot 2.0 解决跨域问题 @@ -67,6 +69,8 @@ public class WebMvcConfiguration implements WebMvcConfigurer { .addResourceLocations("file:" + jeecgBaseConfig.getPath().getWebapp() + "//"); } resourceHandlerRegistration.addResourceLocations(staticLocations.split(",")); + // 设置缓存控制标头 Cache-Control有效期为30天 + resourceHandlerRegistration.setCacheControl(CacheControl.maxAge(30, TimeUnit.DAYS)); } /** diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java index b170fe09..2821ac6b 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/mybatis/MybatisPlusSaasConfig.java @@ -60,7 +60,18 @@ public class MybatisPlusSaasConfig { TENANT_TABLE.add("sys_category"); TENANT_TABLE.add("sys_data_source"); TENANT_TABLE.add("sys_position"); - //TENANT_TABLE.add("sys_announcement"); + //b-2.仪表盘 + TENANT_TABLE.add("onl_drag_page"); + TENANT_TABLE.add("onl_drag_dataset_head"); + TENANT_TABLE.add("jimu_report_data_source"); + TENANT_TABLE.add("jimu_report"); + TENANT_TABLE.add("jimu_dict"); + //b-4.AIRAG + TENANT_TABLE.add("airag_app"); + TENANT_TABLE.add("airag_flow"); + TENANT_TABLE.add("airag_knowledge"); + TENANT_TABLE.add("airag_knowledge_doc"); + TENANT_TABLE.add("airag_model"); } //2.示例测试 diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java index e3b66f85..82c02a7d 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ShiroConfig.java @@ -217,6 +217,10 @@ public class ShiroConfig { //update-begin---author:chenrui ---date:20241202 for:[issues/7491]运行时间好长,效率慢 ------------ registration.addUrlPatterns("/test/ai/chat/send"); //update-end---author:chenrui ---date:20241202 for:[issues/7491]运行时间好长,效率慢 ------------ + registration.addUrlPatterns("/airag/flow/run"); + registration.addUrlPatterns("/airag/flow/debug"); + registration.addUrlPatterns("/airag/chat/send"); + registration.addUrlPatterns("/airag/app/debug"); //支持异步 registration.setAsyncSupported(true); registration.setDispatcherTypes(DispatcherType.REQUEST, DispatcherType.ASYNC); diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/IgnoreAuthPostProcessor.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/IgnoreAuthPostProcessor.java index aa14254f..ff7200b7 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/IgnoreAuthPostProcessor.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/IgnoreAuthPostProcessor.java @@ -91,6 +91,10 @@ public class IgnoreAuthPostProcessor implements InitializingBean { if (bases.length > 0) { for (String base : bases) { for (String uri : uris) { + // 如果uri包含路径占位符, 则需要将其替换为* + if (uri.matches(".*\\{.*}.*")) { + uri = uri.replaceAll("\\{.*?}", "*"); + } urls.add(prefix(base) + prefix(uri)); } } diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/InMemoryIgnoreAuth.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/InMemoryIgnoreAuth.java index bd6a5805..6d6ac5e8 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/InMemoryIgnoreAuth.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/shiro/ignore/InMemoryIgnoreAuth.java @@ -1,5 +1,7 @@ package org.jeecg.config.shiro.ignore; +import org.springframework.util.AntPathMatcher; +import org.springframework.util.PathMatcher; import java.util.ArrayList; import java.util.List; @@ -12,6 +14,7 @@ import java.util.List; public class InMemoryIgnoreAuth { private static final List IGNORE_AUTH_LIST = new ArrayList<>(); + private static PathMatcher MATCHER = new AntPathMatcher(); public InMemoryIgnoreAuth() {} public static void set(List list) { @@ -28,7 +31,7 @@ public class InMemoryIgnoreAuth { public static boolean contains(String url) { for (String ignoreAuth : IGNORE_AUTH_LIST) { - if (url.endsWith(ignoreAuth)) { + if(MATCHER.match(ignoreAuth,url)){ return true; } } diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/IJeecgDemoService.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/IJeecgDemoService.java index f92dd695..cbaa1b4f 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/IJeecgDemoService.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/IJeecgDemoService.java @@ -26,6 +26,12 @@ public interface IJeecgDemoService extends JeecgService { * @return demo对象 */ public JeecgDemo getByIdCacheable(String id); + /** + * 通过id过去demo数据,先读缓存,在读数据库 + * @param id 数据库id + * @return demo对象 + */ + public JeecgDemo getByIdCacheableTTL(String id); /** * 查询列表数据 在service中获取数据权限sql信息 diff --git a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/impl/JeecgDemoServiceImpl.java b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/impl/JeecgDemoServiceImpl.java index 1bcb7746..dfb14434 100644 --- a/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/impl/JeecgDemoServiceImpl.java +++ b/jeecg-boot/jeecg-module-demo/src/main/java/org/jeecg/modules/demo/test/service/impl/JeecgDemoServiceImpl.java @@ -71,6 +71,22 @@ public class JeecgDemoServiceImpl extends ServiceImpl queryListWithPermission(int pageSize,int pageNo) { Page page = new Page<>(pageNo, pageSize); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/CodeTemplateInitListener.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/CodeTemplateInitListener.java index b5404188..2733e916 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/CodeTemplateInitListener.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/CodeTemplateInitListener.java @@ -26,8 +26,11 @@ public class CodeTemplateInitListener implements ApplicationListener { - connector.setProperty("relaxedPathChars", "[]{}"); - connector.setProperty("relaxedQueryChars", "[]{}"); - }); - return factory; - } -} +//package org.jeecg.config.init; +// +//import org.apache.catalina.Context; +//import org.apache.tomcat.util.scan.StandardJarScanner; +//import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory; +//import org.springframework.context.annotation.Bean; +//import org.springframework.context.annotation.Configuration; +// +///** +// * @Description: TomcatFactoryConfig +// * @author: scott +// * @date: 2021年01月25日 11:40 +// */ +//@Configuration +//public class TomcatFactoryConfig { +// /** +// * tomcat-embed-jasper引用后提示jar找不到的问题 +// */ +// @Bean +// public TomcatServletWebServerFactory tomcatFactory() { +// TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory() { +// @Override +// protected void postProcessContext(Context context) { +// ((StandardJarScanner) context.getJarScanner()).setScanManifest(false); +// } +// }; +// factory.addConnectorCustomizers(connector -> { +// connector.setProperty("relaxedPathChars", "[]{}"); +// connector.setProperty("relaxedQueryChars", "[]{}"); +// }); +// return factory; +// } +//} diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java index 8d47b01d..c9ac2c3e 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/LoginController.java @@ -88,8 +88,10 @@ public class LoginController { } String lowerCaseCaptcha = captcha.toLowerCase(); // 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可 - String origin = lowerCaseCaptcha+sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret(); - String realKey = Md5Util.md5Encode(origin, "utf-8"); + //update-begin---author:chenrui ---date:20250107 for:[QQYUN-10775]验证码可以复用 #7674------------ + String keyPrefix = Md5Util.md5Encode(sysLoginModel.getCheckKey()+jeecgBaseConfig.getSignatureSecret(), "utf-8"); + String realKey = keyPrefix + lowerCaseCaptcha; + //update-end---author:chenrui ---date:20250107 for:[QQYUN-10775]验证码可以复用 #7674------------ Object checkCode = redisUtil.get(realKey); //当进入登录页时,有一定几率出现验证码错误 #1714 if(checkCode==null || !checkCode.toString().equals(lowerCaseCaptcha)) { @@ -533,10 +535,12 @@ public class LoginController { //update-begin-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906 // 加入密钥作为混淆,避免简单的拼接,被外部利用,用户自定义该密钥即可 - String origin = lowerCaseCode+key+jeecgBaseConfig.getSignatureSecret(); - String realKey = Md5Util.md5Encode(origin, "utf-8"); + //update-begin---author:chenrui ---date:20250107 for:[QQYUN-10775]验证码可以复用 #7674------------ + String keyPrefix = Md5Util.md5Encode(key+jeecgBaseConfig.getSignatureSecret(), "utf-8"); + String realKey = keyPrefix + lowerCaseCode; //update-end-author:taoyan date:2022-9-13 for: VUEN-2245 【漏洞】发现新漏洞待处理20220906 - + redisUtil.removeAll(keyPrefix); + //update-end---author:chenrui ---date:20250107 for:[QQYUN-10775]验证码可以复用 #7674------------ redisUtil.set(realKey, lowerCaseCode, 60); log.info("获取验证码,Redis key = {},checkCode = {}", realKey, code); //返回前端 diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java index 0a46d979..871e39fd 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysRoleController.java @@ -101,7 +101,13 @@ public class SysRoleController { public Result> queryPageList(SysRole role, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + @RequestParam(name="isMultiTranslate", required = false) Boolean isMultiTranslate, HttpServletRequest req) { + //update-begin---author:wangshuai---date:2025-03-26---for:【issues/7948】角色解决根据id查询回显不对--- + if(null != isMultiTranslate && isMultiTranslate){ + pageSize = 100; + } + //update-end---author:wangshuai---date:2025-03-26---for:【issues/7948】角色解决根据id查询回显不对--- Result> result = new Result>(); //QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(role, req.getParameterMap()); //IPage pageList = sysRoleService.page(page, queryWrapper); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTenantController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTenantController.java index f7869aca..5f630cf6 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTenantController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/controller/SysTenantController.java @@ -23,7 +23,11 @@ import org.jeecg.common.util.oConvertUtils; import org.jeecg.config.mybatis.MybatisPlusSaasConfig; import org.jeecg.modules.base.service.BaseCommonService; import org.jeecg.modules.system.entity.*; -import org.jeecg.modules.system.service.*; +import org.jeecg.modules.system.service.ISysTenantPackService; +import org.jeecg.modules.system.service.ISysTenantService; +import org.jeecg.modules.system.service.ISysUserService; +import org.jeecg.modules.system.service.ISysUserTenantService; +import org.jeecg.modules.system.service.ISysDepartService; import org.jeecg.modules.system.vo.SysUserTenantVo; import org.jeecg.modules.system.vo.tenant.TenantDepartAuthInfo; import org.jeecg.modules.system.vo.tenant.TenantPackModel; diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml index ce518918..8d7df92f 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysDepartMapper.xml @@ -136,7 +136,7 @@ diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysTenantMapper.xml b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysTenantMapper.xml index 49dbb4fc..0b4240ae 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysTenantMapper.xml +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/system/mapper/xml/SysTenantMapper.xml @@ -43,8 +43,7 @@