fix: 修复部分配置错误
This commit is contained in:
parent
0aafcc015c
commit
40e11a7a25
@ -54,8 +54,8 @@ ContiNew Admin 中后台管理框架/脚手架,Continue New Admin,持续以
|
|||||||
|
|
||||||
**v2.0.0:** :fire: 升级并适配 Spring Boot 3.x。
|
**v2.0.0:** :fire: 升级并适配 Spring Boot 3.x。
|
||||||
|
|
||||||
- [ ] 依赖升级:升级并适配 Spring Boot 3.x
|
- [x] 依赖升级:升级并适配 Spring Boot 3.x
|
||||||
- [ ] 依赖升级:其他依赖升级
|
- [x] 依赖升级:其他依赖升级
|
||||||
- [ ] 计划对接 <a href="https://gitee.com/aizuda/flowlong" target="_blank">FlowLong</a> 纯国产工作流引擎
|
- [ ] 计划对接 <a href="https://gitee.com/aizuda/flowlong" target="_blank">FlowLong</a> 纯国产工作流引擎
|
||||||
- [ ] 其他需求汇集中...
|
- [ ] 其他需求汇集中...
|
||||||
|
|
||||||
|
@ -16,21 +16,19 @@
|
|||||||
|
|
||||||
package top.charles7c.cnadmin.common.handler;
|
package top.charles7c.cnadmin.common.handler;
|
||||||
|
|
||||||
import static top.charles7c.cnadmin.common.annotation.CrudRequestMapping.Api;
|
import cn.hutool.core.util.ArrayUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
import java.lang.reflect.Method;
|
|
||||||
|
|
||||||
import org.springframework.lang.NonNull;
|
import org.springframework.lang.NonNull;
|
||||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||||
import org.springframework.web.util.pattern.PathPatternParser;
|
import org.springframework.web.util.pattern.PathPatternParser;
|
||||||
|
|
||||||
import cn.hutool.core.util.ArrayUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
|
|
||||||
import top.charles7c.cnadmin.common.annotation.CrudRequestMapping;
|
import top.charles7c.cnadmin.common.annotation.CrudRequestMapping;
|
||||||
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
import top.charles7c.cnadmin.common.util.ExceptionUtils;
|
||||||
|
|
||||||
|
import java.lang.reflect.Method;
|
||||||
|
|
||||||
|
import static top.charles7c.cnadmin.common.annotation.CrudRequestMapping.Api;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* CRUD 请求映射器处理器映射器
|
* CRUD 请求映射器处理器映射器
|
||||||
*
|
*
|
||||||
@ -56,14 +54,14 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi
|
|||||||
// 拼接路径前缀(合并了 @RequestMapping 的部分能力)
|
// 拼接路径前缀(合并了 @RequestMapping 的部分能力)
|
||||||
String pathPrefix = crudRequestMapping.value();
|
String pathPrefix = crudRequestMapping.value();
|
||||||
if (StrUtil.isNotBlank(pathPrefix)) {
|
if (StrUtil.isNotBlank(pathPrefix)) {
|
||||||
/**
|
/*
|
||||||
* 问题:RequestMappingInfo.paths(pathPrefix)返回的RequestMappingInfo对象里pathPatternsCondition = null
|
* 问题:RequestMappingInfo.paths(pathPrefix) 返回的 RequestMappingInfo 对象里 pathPatternsCondition = null
|
||||||
* 导致combine()方法抛出断言异常!
|
* 导致 combine() 方法抛出断言异常! 修复:创建 options 对象,并设置 PatternParser
|
||||||
* 修复: 创建options对象, 并设置PatternParser
|
|
||||||
*/
|
*/
|
||||||
RequestMappingInfo.BuilderConfiguration options = new RequestMappingInfo.BuilderConfiguration();
|
RequestMappingInfo.BuilderConfiguration options = new RequestMappingInfo.BuilderConfiguration();
|
||||||
options.setPatternParser(PathPatternParser.defaultInstance);
|
options.setPatternParser(PathPatternParser.defaultInstance);
|
||||||
requestMappingInfo = RequestMappingInfo.paths(pathPrefix).options(options).build().combine(requestMappingInfo);
|
requestMappingInfo =
|
||||||
|
RequestMappingInfo.paths(pathPrefix).options(options).build().combine(requestMappingInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 过滤 API
|
// 过滤 API
|
||||||
|
@ -218,8 +218,8 @@ public class LogInterceptor implements HandlerInterceptor {
|
|||||||
logDO.setRequestHeaders(this.desensitize(JakartaServletUtil.getHeaderMap(request)));
|
logDO.setRequestHeaders(this.desensitize(JakartaServletUtil.getHeaderMap(request)));
|
||||||
String requestBody = this.getRequestBody(request);
|
String requestBody = this.getRequestBody(request);
|
||||||
if (StrUtil.isNotBlank(requestBody)) {
|
if (StrUtil.isNotBlank(requestBody)) {
|
||||||
logDO.setRequestBody(this.desensitize(
|
logDO.setRequestBody(this.desensitize(JSONUtil.isTypeJSON(requestBody) ? JSONUtil.parseObj(requestBody)
|
||||||
JSONUtil.isTypeJSON(requestBody) ? JSONUtil.parseObj(requestBody) : JakartaServletUtil.getParamMap(request)));
|
: JakartaServletUtil.getParamMap(request)));
|
||||||
}
|
}
|
||||||
logDO.setClientIp(JakartaServletUtil.getClientIP(request));
|
logDO.setClientIp(JakartaServletUtil.getClientIP(request));
|
||||||
logDO.setLocation(IpUtils.getCityInfo(logDO.getClientIp()));
|
logDO.setLocation(IpUtils.getCityInfo(logDO.getClientIp()));
|
||||||
|
@ -30,7 +30,6 @@ import cn.dev33.satoken.jwt.StpLogicJwtForSimple;
|
|||||||
import cn.dev33.satoken.stp.StpInterface;
|
import cn.dev33.satoken.stp.StpInterface;
|
||||||
import cn.dev33.satoken.stp.StpLogic;
|
import cn.dev33.satoken.stp.StpLogic;
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
import cn.dev33.satoken.stp.StpUtil;
|
||||||
import top.charles7c.cnadmin.auth.config.satoken.properties.SecurityProperties;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sa-Token 配置
|
* Sa-Token 配置
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package top.charles7c.cnadmin.auth.config.satoken.properties;
|
package top.charles7c.cnadmin.auth.config.satoken;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
@ -52,14 +52,14 @@ public class MenuController extends BaseController<MenuService, MenuVO, MenuVO,
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SaCheckPermission("system:menu:add")
|
@SaCheckPermission("system:menu:add")
|
||||||
protected R<Long> add(@Validated(BaseRequest.Add.class) @RequestBody MenuRequest request) {
|
public R<Long> add(@Validated(BaseRequest.Add.class) @RequestBody MenuRequest request) {
|
||||||
this.checkPath(request);
|
this.checkPath(request);
|
||||||
return super.add(request);
|
return super.add(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SaCheckPermission("system:menu:update")
|
@SaCheckPermission("system:menu:update")
|
||||||
protected R update(@Validated(BaseRequest.Update.class) @RequestBody MenuRequest request, @PathVariable Long id) {
|
public R update(@Validated(BaseRequest.Update.class) @RequestBody MenuRequest request, @PathVariable Long id) {
|
||||||
this.checkPath(request);
|
this.checkPath(request);
|
||||||
return super.update(request, id);
|
return super.update(request, id);
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,7 @@ spring:
|
|||||||
master:
|
master:
|
||||||
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
url: jdbc:mysql://${DB_HOST:127.0.0.1}:${DB_PORT:3306}/${DB_NAME:continew_admin}?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowMultiQueries=true&rewriteBatchedStatements=true&autoReconnect=true&maxReconnects=10&failOverReadOnly=false
|
||||||
username: ${DB_USER:root}
|
username: ${DB_USER:root}
|
||||||
password: ${DB_PWD:root}
|
password: ${DB_PWD:123456}
|
||||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||||
# 从库配置(可配多个,构成多从)
|
# 从库配置(可配多个,构成多从)
|
||||||
slave_1:
|
slave_1:
|
||||||
@ -60,7 +60,7 @@ spring:
|
|||||||
# 端口(默认 6379)
|
# 端口(默认 6379)
|
||||||
port: ${REDIS_PORT:6379}
|
port: ${REDIS_PORT:6379}
|
||||||
# 密码(未设置密码时可为空或注释掉)
|
# 密码(未设置密码时可为空或注释掉)
|
||||||
# password: ${REDIS_PWD:123456}
|
password: ${REDIS_PWD:123456}
|
||||||
# 数据库索引
|
# 数据库索引
|
||||||
database: ${REDIS_DB:0}
|
database: ${REDIS_DB:0}
|
||||||
# 连接超时时间
|
# 连接超时时间
|
||||||
|
@ -53,6 +53,7 @@ spring.liquibase:
|
|||||||
|
|
||||||
--- ### Redis 单机配置
|
--- ### Redis 单机配置
|
||||||
spring:
|
spring:
|
||||||
|
data:
|
||||||
redis:
|
redis:
|
||||||
# 地址
|
# 地址
|
||||||
host: ${REDIS_HOST:127.0.0.1}
|
host: ${REDIS_HOST:127.0.0.1}
|
||||||
|
@ -188,6 +188,13 @@ spring:
|
|||||||
# 允许反序列化不存在的属性
|
# 允许反序列化不存在的属性
|
||||||
FAIL_ON_UNKNOWN_PROPERTIES: false
|
FAIL_ON_UNKNOWN_PROPERTIES: false
|
||||||
|
|
||||||
|
--- ### 健康检查配置
|
||||||
|
management:
|
||||||
|
health:
|
||||||
|
mail:
|
||||||
|
# 关闭邮箱健康检查(邮箱配置错误或邮箱服务器不可用时,健康检查会报错)
|
||||||
|
enabled: false
|
||||||
|
|
||||||
--- ### 线程池配置
|
--- ### 线程池配置
|
||||||
thread-pool:
|
thread-pool:
|
||||||
# 是否启用线程池
|
# 是否启用线程池
|
||||||
@ -196,22 +203,3 @@ thread-pool:
|
|||||||
queueCapacity: 128
|
queueCapacity: 128
|
||||||
# 活跃时间
|
# 活跃时间
|
||||||
keepAliveSeconds: 300
|
keepAliveSeconds: 300
|
||||||
|
|
||||||
management:
|
|
||||||
health:
|
|
||||||
mail:
|
|
||||||
# 临时关闭邮箱健康检查
|
|
||||||
# 注: 邮箱参数没有正确配置会出现mail health异常
|
|
||||||
enabled: false
|
|
||||||
# redis:
|
|
||||||
# # redis
|
|
||||||
# enabled: false
|
|
||||||
# mongo:
|
|
||||||
# # 关闭mongodb健康检查
|
|
||||||
# enabled: false
|
|
||||||
# solr:
|
|
||||||
# # 关闭solr健康检查
|
|
||||||
# enabled: false
|
|
||||||
# elasticsearch:
|
|
||||||
# # 关闭es健康检查
|
|
||||||
# enabled: false
|
|
2
pom.xml
2
pom.xml
@ -251,7 +251,7 @@ limitations under the License.
|
|||||||
<configuration>
|
<configuration>
|
||||||
<java>
|
<java>
|
||||||
<importOrder>
|
<importOrder>
|
||||||
<order>java,javax,lombok,io,org,com,cn,top.charles7c,</order>
|
<order>java,jakarta,lombok,io,org,com,cn,top.charles7c,</order>
|
||||||
</importOrder>
|
</importOrder>
|
||||||
<removeUnusedImports/>
|
<removeUnusedImports/>
|
||||||
<eclipse>
|
<eclipse>
|
||||||
|
Loading…
Reference in New Issue
Block a user