From bd97aad26b7504e27550a1197deaafd6763f2591 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Tue, 7 Jul 2026 13:41:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7springboot4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecg-boot/jeecg-boot-base-core/pom.xml | 18 ++-- .../jeecg/common/util/RestDesformUtil.java | 2 +- .../java/org/jeecg/common/util/RestUtil.java | 8 +- .../java/org/jeecg/config/DruidConfig.java | 4 +- .../org/jeecg/config/shiro/ShiroConfig.java | 11 ++- .../airag/llm/handler/PluginToolBuilder.java | 2 +- .../config/init/TomcatFactoryConfig.java | 2 +- .../actuator/CustomActuatorConfig.java | 4 +- .../service/impl/MailHealthIndicator.java | 4 +- .../openapi/controller/OpenApiController.java | 2 +- .../org/jeecg/JeecgSystemApplication.java | 4 +- .../src/main/resources/application-dev.yml | 15 +-- .../org/jeecg/JeecgGatewayApplication.java | 2 +- .../jeecg-visual/jeecg-cloud-monitor/pom.xml | 2 +- .../monitor/config/SecuritySecureConfig.java | 56 +++++------ .../xxl/job/admin/core/util/JacksonUtil.java | 92 ------------------- jeecg-boot/pom.xml | 17 +++- 17 files changed, 85 insertions(+), 160 deletions(-) delete mode 100644 jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/core/util/JacksonUtil.java diff --git a/jeecg-boot/jeecg-boot-base-core/pom.xml b/jeecg-boot/jeecg-boot-base-core/pom.xml index 2c3e52520..d43eeec7b 100644 --- a/jeecg-boot/jeecg-boot-base-core/pom.xml +++ b/jeecg-boot/jeecg-boot-base-core/pom.xml @@ -65,10 +65,10 @@ org.springframework.boot spring-boot-starter-mail - + org.springframework.boot spring-boot-starter-actuator @@ -104,7 +104,7 @@ com.baomidou - mybatis-plus-spring-boot3-starter + mybatis-plus-spring-boot4-starter ${mybatis-plus.version} @@ -121,15 +121,19 @@ com.alibaba - druid-spring-boot-3-starter - ${druid.version} + druid-spring-boot-4-starter + 1.2.28 + + + org.springframework.boot + spring-boot-starter-jdbc com.baomidou - dynamic-datasource-spring-boot3-starter - ${dynamic-datasource-spring-boot-starter.version} + dynamic-datasource-spring-boot4-starter + 4.5.0 diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestDesformUtil.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestDesformUtil.java index d68434694..9a43d371f 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestDesformUtil.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestDesformUtil.java @@ -111,7 +111,7 @@ public class RestDesformUtil { private static HttpHeaders getHeaders(String token) { HttpHeaders headers = new HttpHeaders(); - String mediaType = MediaType.APPLICATION_JSON_UTF8_VALUE; + String mediaType = MediaType.APPLICATION_JSON_VALUE; headers.setContentType(MediaType.parseMediaType(mediaType)); headers.set("Accept", mediaType); headers.set("X-Access-Token", token); diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestUtil.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestUtil.java index 8b5ae8a12..7503c6cc9 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestUtil.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/common/util/RestUtil.java @@ -61,7 +61,7 @@ public class RestUtil { // 解决[issues/8859]online表单java增强失效------------ // 使用 Apache HttpClient 避免 JDK HttpURLConnection 的 too many bytes written 问题 HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); - requestFactory.setConnectTimeout(30000); + requestFactory.setConnectionRequestTimeout(30000); requestFactory.setReadTimeout(30000); RT = new RestTemplate(requestFactory); // 解决乱码问题(替换 StringHttpMessageConverter 为 UTF-8) @@ -271,7 +271,7 @@ public class RestUtil { if (timeout > 0) { // 代码逻辑说明: [issues/8859]online表单java增强失效------------ HttpComponentsClientHttpRequestFactory requestFactory = new HttpComponentsClientHttpRequestFactory(); - requestFactory.setConnectTimeout(timeout); + requestFactory.setConnectionRequestTimeout(timeout); requestFactory.setReadTimeout(timeout); restTemplate = new RestTemplate(requestFactory); // 解决乱码问题(替换 StringHttpMessageConverter 为 UTF-8) @@ -299,7 +299,7 @@ public class RestUtil { } // Content-Length 强制设置(解决可能出现的截断问题) - if (StringUtils.isNotEmpty(body) && !headers.containsKey(HttpHeaders.CONTENT_LENGTH)) { + if (StringUtils.isNotEmpty(body) && !headers.containsHeader(HttpHeaders.CONTENT_LENGTH)) { int contentLength = body.getBytes(StandardCharsets.UTF_8).length; String current = headers.getFirst(HttpHeaders.CONTENT_LENGTH); if (current == null || !current.equals(String.valueOf(contentLength))) { @@ -317,7 +317,7 @@ public class RestUtil { * 获取JSON请求头 */ public static HttpHeaders getHeaderApplicationJson() { - return getHeader(MediaType.APPLICATION_JSON_UTF8_VALUE); + return getHeader(MediaType.APPLICATION_JSON_VALUE); } /** diff --git a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java index 84b33f5a5..b69d6d87a 100644 --- a/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java +++ b/jeecg-boot/jeecg-boot-base-core/src/main/java/org/jeecg/config/DruidConfig.java @@ -2,8 +2,8 @@ package org.jeecg.config; import java.io.IOException; -import com.alibaba.druid.spring.boot3.autoconfigure.DruidDataSourceAutoConfigure; -import com.alibaba.druid.spring.boot3.autoconfigure.properties.DruidStatProperties; +import com.alibaba.druid.spring.boot4.autoconfigure.DruidDataSourceAutoConfigure; +import com.alibaba.druid.spring.boot4.autoconfigure.properties.DruidStatProperties; import jakarta.servlet.*; import org.springframework.boot.autoconfigure.AutoConfigureAfter; 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 6f4d17890..b6214f864 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 @@ -23,14 +23,11 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.config.BeanDefinition; import org.springframework.boot.web.servlet.FilterRegistrationBean; import org.springframework.context.annotation.*; -import org.springframework.core.annotation.AnnotationUtils; import org.springframework.core.env.Environment; -import org.springframework.core.type.filter.AnnotationTypeFilter; +import org.springframework.boot.data.redis.autoconfigure.DataRedisProperties; import org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory; -import org.springframework.boot.autoconfigure.data.redis.RedisProperties; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; -import org.springframework.web.bind.annotation.*; import org.springframework.web.filter.DelegatingFilterProxy; import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; import redis.clients.jedis.HostAndPort; @@ -55,8 +52,10 @@ public class ShiroConfig { private Environment env; @Resource private JeecgBaseConfig jeecgBaseConfig; + //update-begin---author:scott ---date:2026-07-07 for:【Spring Boot 4.0 升级】RedisProperties 改名为 DataRedisProperties,包路径变更----------- @Autowired(required = false) - private RedisProperties redisProperties; + private DataRedisProperties redisProperties; + //update-end---author:scott ---date:2026-07-07 for:【Spring Boot 4.0 升级】RedisProperties 改名为 DataRedisProperties,包路径变更----------- /** * Filter Chain定义说明 @@ -327,6 +326,7 @@ public class ShiroConfig { public IRedisManager redisManager() { log.info("===============(2)创建RedisManager,连接Redis.."); IRedisManager manager; + //update-begin---author:scott ---date:2026-07-07 for:【Spring Boot 4.0 升级】恢复 Sentinel 哨兵模式支持,API 兼容----------- // sentinel cluster redis(【issues/5569】shiro集成 redis 不支持 sentinel 方式部署的redis集群 #5569) if (Objects.nonNull(redisProperties) && Objects.nonNull(redisProperties.getSentinel()) @@ -339,6 +339,7 @@ public class ShiroConfig { return sentinelManager; } + //update-end---author:scott ---date:2026-07-07 for:【Spring Boot 4.0 升级】恢复 Sentinel 哨兵模式支持,API 兼容----------- // redis 单机支持,在集群为空,或者集群无机器时候使用 add by jzyadmin@163.com if (lettuceConnectionFactory.getClusterConfiguration() == null || lettuceConnectionFactory.getClusterConfiguration().getClusterNodes().isEmpty()) { diff --git a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/PluginToolBuilder.java b/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/PluginToolBuilder.java index 0abe55fe8..153cd007b 100644 --- a/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/PluginToolBuilder.java +++ b/jeecg-boot/jeecg-boot-module/jeecg-boot-module-airag/src/main/java/org/jeecg/modules/airag/llm/handler/PluginToolBuilder.java @@ -326,7 +326,7 @@ public class PluginToolBuilder { } // 如果请求体不为空且没有设置Content-Type,默认设置为application/json - if (!httpHeaders.containsKey(HttpHeaders.CONTENT_TYPE)) { + if (!httpHeaders.containsHeader(HttpHeaders.CONTENT_TYPE)) { httpHeaders.setContentType(MediaType.APPLICATION_JSON); } diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/TomcatFactoryConfig.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/TomcatFactoryConfig.java index ac4d2a5b4..49c6442d7 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/TomcatFactoryConfig.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/config/init/TomcatFactoryConfig.java @@ -2,7 +2,7 @@ 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.boot.tomcat.servlet.TomcatServletWebServerFactory; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/actuator/CustomActuatorConfig.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/actuator/CustomActuatorConfig.java index a7c85b09f..bc832da10 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/actuator/CustomActuatorConfig.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/actuator/CustomActuatorConfig.java @@ -1,7 +1,7 @@ package org.jeecg.modules.monitor.actuator; import org.jeecg.modules.monitor.actuator.httptrace.CustomInMemoryHttpTraceRepository; -import org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesAutoConfiguration; +import org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesEndpointAutoConfiguration; import org.springframework.boot.actuate.autoconfigure.web.exchanges.HttpExchangesProperties; import org.springframework.boot.actuate.web.exchanges.HttpExchangeRepository; import org.springframework.boot.autoconfigure.AutoConfigureBefore; @@ -19,7 +19,7 @@ import org.springframework.context.annotation.Configuration; */ @Configuration @EnableConfigurationProperties(HttpExchangesProperties.class) -@AutoConfigureBefore(HttpExchangesAutoConfiguration.class) +@AutoConfigureBefore(HttpExchangesEndpointAutoConfiguration.class) public class CustomActuatorConfig { /** diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/service/impl/MailHealthIndicator.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/service/impl/MailHealthIndicator.java index ea8641083..be4ce2c40 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/service/impl/MailHealthIndicator.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/monitor/service/impl/MailHealthIndicator.java @@ -1,7 +1,7 @@ package org.jeecg.modules.monitor.service.impl; -import org.springframework.boot.actuate.health.Health; -import org.springframework.boot.actuate.health.HealthIndicator; +import org.springframework.boot.health.contributor.Health; +import org.springframework.boot.health.contributor.HealthIndicator; import org.springframework.stereotype.Component; /** diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/controller/OpenApiController.java b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/controller/OpenApiController.java index 13e782447..6d1fac167 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/controller/OpenApiController.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/openapi/controller/OpenApiController.java @@ -195,7 +195,7 @@ public class OpenApiController extends JeecgController url = CommonUtils.getBaseUrl(request) + url; } //update-end---author:scott ---date:20260429 for:【issues/9590】微服务nginx部署openApi接口访问不到----------- - UriComponentsBuilder builder = UriComponentsBuilder.fromHttpUrl(url); + UriComponentsBuilder builder = UriComponentsBuilder.fromUriString(url); if (HttpMethod.GET.matches(method) || HttpMethod.DELETE.matches(method) || HttpMethod.OPTIONS.matches(method) diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java index 0fe431e2e..82168a150 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/java/org/jeecg/JeecgSystemApplication.java @@ -6,7 +6,6 @@ import org.jeecg.common.util.oConvertUtils; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.ImportAutoConfiguration; import org.springframework.boot.autoconfigure.SpringBootApplication; -import org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration; import org.springframework.boot.builder.SpringApplicationBuilder; import org.springframework.boot.web.servlet.support.SpringBootServletInitializer; import org.springframework.context.ConfigurableApplicationContext; @@ -22,7 +21,6 @@ import java.util.Map; * 报错提醒: 未集成mongo报错,可以打开启动类上面的注释 exclude={MongoAutoConfiguration.class} */ @Slf4j -@SpringBootApplication(exclude = MongoAutoConfiguration.class) @ImportAutoConfiguration(JustAuthAutoConfiguration.class) // spring boot 3.x justauth 兼容性处理 public class JeecgSystemApplication extends SpringBootServletInitializer { @@ -38,7 +36,7 @@ public class JeecgSystemApplication extends SpringBootServletInitializer { app.setDefaultProperties(defaultProperties); log.info("[JEECG] Elasticsearch Health Check Enabled: false" ); - ConfigurableApplicationContext application = app.run(args);; + ConfigurableApplicationContext application = app.run(args); Environment env = application.getEnvironment(); String ip = InetAddress.getLocalHost().getHostAddress(); String port = env.getProperty("server.port"); diff --git a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml index b2b2e4870..da3d473d2 100644 --- a/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml +++ b/jeecg-boot/jeecg-module-system/jeecg-system-start/src/main/resources/application-dev.yml @@ -2,10 +2,6 @@ server: port: 8080 tomcat: max-swallow-size: -1 - error: - include-exception: true - include-stacktrace: ALWAYS - include-message: ALWAYS servlet: context-path: /jeecg-boot compression: @@ -20,9 +16,14 @@ management: include: metrics,httpexchanges,jeecghttptrace spring: -# main: -# # 启动加速 (建议开发环境,开启后flyway自动升级失效) -# lazy-initialization: true + # main: + # # 启动加速 (建议开发环境,开启后flyway自动升级失效) + # lazy-initialization: true + web: + error: + include-exception: true + include-stacktrace: ALWAYS + include-message: ALWAYS flyway: # 是否启用flyway enabled: false diff --git a/jeecg-boot/jeecg-server-cloud/jeecg-cloud-gateway/src/main/java/org/jeecg/JeecgGatewayApplication.java b/jeecg-boot/jeecg-server-cloud/jeecg-cloud-gateway/src/main/java/org/jeecg/JeecgGatewayApplication.java index 8d4c3f69c..807eff5b0 100644 --- a/jeecg-boot/jeecg-server-cloud/jeecg-cloud-gateway/src/main/java/org/jeecg/JeecgGatewayApplication.java +++ b/jeecg-boot/jeecg-server-cloud/jeecg-cloud-gateway/src/main/java/org/jeecg/JeecgGatewayApplication.java @@ -52,6 +52,6 @@ public class JeecgGatewayApplication implements CommandLineRunner { */ @Bean public RouterFunction indexRouter(@Value("classpath:/META-INF/resources/doc.html") final org.springframework.core.io.Resource indexHtml) { - return route(GET("/"), request -> ok().contentType(MediaType.TEXT_HTML).syncBody(indexHtml)); + return route(GET("/"), request -> ok().contentType(MediaType.TEXT_HTML).bodyValue(indexHtml)); } } diff --git a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/pom.xml b/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/pom.xml index 4b75eebea..f5c772710 100644 --- a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/pom.xml +++ b/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/pom.xml @@ -50,7 +50,7 @@ org.springframework.boot - spring-boot-starter-undertow + spring-boot-starter-webflux diff --git a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/src/main/java/org/jeecg/monitor/config/SecuritySecureConfig.java b/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/src/main/java/org/jeecg/monitor/config/SecuritySecureConfig.java index cd49b69b7..dda1672a3 100644 --- a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/src/main/java/org/jeecg/monitor/config/SecuritySecureConfig.java +++ b/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-monitor/src/main/java/org/jeecg/monitor/config/SecuritySecureConfig.java @@ -1,6 +1,7 @@ package org.jeecg.monitor.config; import de.codecentric.boot.admin.server.config.AdminServerProperties; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.Customizer; import org.springframework.security.config.annotation.web.builders.HttpSecurity; @@ -20,39 +21,40 @@ public class SecuritySecureConfig { this.adminContextPath = adminServerProperties.getContextPath(); } - + @Bean public SecurityFilterChain configure(HttpSecurity http) throws Exception { // 登录成功处理类 SavedRequestAwareAuthenticationSuccessHandler successHandler = new SavedRequestAwareAuthenticationSuccessHandler(); successHandler.setTargetUrlParameter("redirectTo"); successHandler.setDefaultTargetUrl(adminContextPath + "/"); - http.authorizeRequests(authorize -> { - try { - authorize - - //静态文件允许访问 - .requestMatchers(adminContextPath + "/assets/**").permitAll() - //登录页面允许访问 - .requestMatchers(adminContextPath + "/login", "/css/**", "/js/**", "/image/*").permitAll() - //其他所有请求需要登录 - .anyRequest().authenticated() - .and() - //登录页面配置,用于替换security默认页面 - .formLogin(formLogin -> formLogin.loginPage(adminContextPath + "/login").successHandler(successHandler)) - //登出页面配置,用于替换security默认页面 - .logout(logout -> logout.logoutUrl(adminContextPath + "/logout")) - .httpBasic(Customizer.withDefaults()) - .csrf(csrf -> csrf.csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) - .ignoringRequestMatchers( - "/instances", - "/actuator/**") - ); - } catch (Exception e) { - e.printStackTrace(); - } - } - ); + http + // authorizeRequests() 已废弃,使用 authorizeHttpRequests() + .authorizeHttpRequests(authorize -> authorize + //静态文件允许访问 + .requestMatchers(adminContextPath + "/assets/**").permitAll() + //登录页面允许访问 + .requestMatchers(adminContextPath + "/login", "/css/**", "/js/**", "/image/*").permitAll() + //其他所有请求需要登录 + .anyRequest().authenticated() + ) + //登录页面配置,用于替换security默认页面 + .formLogin(formLogin -> formLogin + .loginPage(adminContextPath + "/login") + .successHandler(successHandler) + ) + //登出页面配置,用于替换security默认页面 + .logout(logout -> logout + .logoutUrl(adminContextPath + "/logout") + ) + .httpBasic(Customizer.withDefaults()) + .csrf(csrf -> csrf + .csrfTokenRepository(CookieCsrfTokenRepository.withHttpOnlyFalse()) + .ignoringRequestMatchers( + "/instances", + "/actuator/**" + ) + ); return http.build(); diff --git a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/core/util/JacksonUtil.java b/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/core/util/JacksonUtil.java deleted file mode 100644 index 4f4ea3ccb..000000000 --- a/jeecg-boot/jeecg-server-cloud/jeecg-visual/jeecg-cloud-xxljob/src/main/java/com/xxl/job/admin/core/util/JacksonUtil.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.xxl.job.admin.core.util; - -import com.fasterxml.jackson.core.JsonGenerationException; -import com.fasterxml.jackson.core.JsonParseException; -import com.fasterxml.jackson.databind.JavaType; -import com.fasterxml.jackson.databind.JsonMappingException; -import com.fasterxml.jackson.databind.ObjectMapper; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import java.io.IOException; - -/** - * Jackson util - * - * 1、obj need private and set/get; - * 2、do not support inner class; - * - * @author xuxueli 2015-9-25 18:02:56 - */ -public class JacksonUtil { - private static Logger logger = LoggerFactory.getLogger(JacksonUtil.class); - - private final static ObjectMapper objectMapper = new ObjectMapper(); - public static ObjectMapper getInstance() { - return objectMapper; - } - - /** - * bean、array、List、Map --> json - * - * @param obj - * @return json string - * @throws Exception - */ - public static String writeValueAsString(Object obj) { - try { - return getInstance().writeValueAsString(obj); - } catch (JsonGenerationException e) { - logger.error(e.getMessage(), e); - } catch (JsonMappingException e) { - logger.error(e.getMessage(), e); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - /** - * string --> bean、Map、List(array) - * - * @param jsonStr - * @param clazz - * @return obj - * @throws Exception - */ - public static T readValue(String jsonStr, Class clazz) { - try { - return getInstance().readValue(jsonStr, clazz); - } catch (JsonParseException e) { - logger.error(e.getMessage(), e); - } catch (JsonMappingException e) { - logger.error(e.getMessage(), e); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return null; - } - - /** - * string --> List... - * - * @param jsonStr - * @param parametrized - * @param parameterClasses - * @param - * @return - */ - public static T readValue(String jsonStr, Class parametrized, Class... parameterClasses) { - try { - JavaType javaType = getInstance().getTypeFactory().constructParametricType(parametrized, parameterClasses); - return getInstance().readValue(jsonStr, javaType); - } catch (JsonParseException e) { - logger.error(e.getMessage(), e); - } catch (JsonMappingException e) { - logger.error(e.getMessage(), e); - } catch (IOException e) { - logger.error(e.getMessage(), e); - } - return null; - } -} diff --git a/jeecg-boot/pom.xml b/jeecg-boot/pom.xml index 0eeba05a4..5c48a56db 100644 --- a/jeecg-boot/pom.xml +++ b/jeecg-boot/pom.xml @@ -23,7 +23,7 @@ org.springframework.boot spring-boot-starter-parent - 3.5.5 + 4.1.0 @@ -34,8 +34,8 @@ UTF-8 - 2025.0.0 - 2023.0.3.3 + 2025.1.2 + 2025.1.0.0 2.0.4 2.4.1 @@ -118,6 +118,16 @@ true + + github + https://maven.pkg.github.com/alibaba/spring-cloud-alibaba + + false + + + true + + @@ -225,6 +235,7 @@ jeecg-boot-starter-job 3.9.2 + org.jeecgframework.boot3