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。
|
||||
|
||||
- [ ] 依赖升级:升级并适配 Spring Boot 3.x
|
||||
- [ ] 依赖升级:其他依赖升级
|
||||
- [x] 依赖升级:升级并适配 Spring Boot 3.x
|
||||
- [x] 依赖升级:其他依赖升级
|
||||
- [ ] 计划对接 <a href="https://gitee.com/aizuda/flowlong" target="_blank">FlowLong</a> 纯国产工作流引擎
|
||||
- [ ] 其他需求汇集中...
|
||||
|
||||
|
@ -16,21 +16,19 @@
|
||||
|
||||
package top.charles7c.cnadmin.common.handler;
|
||||
|
||||
import static top.charles7c.cnadmin.common.annotation.CrudRequestMapping.Api;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import cn.hutool.core.util.ArrayUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import org.springframework.lang.NonNull;
|
||||
import org.springframework.web.servlet.mvc.method.RequestMappingInfo;
|
||||
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;
|
||||
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.util.ExceptionUtils;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
import static top.charles7c.cnadmin.common.annotation.CrudRequestMapping.Api;
|
||||
|
||||
/**
|
||||
* CRUD 请求映射器处理器映射器
|
||||
*
|
||||
@ -56,14 +54,14 @@ public class CrudRequestMappingHandlerMapping extends RequestMappingHandlerMappi
|
||||
// 拼接路径前缀(合并了 @RequestMapping 的部分能力)
|
||||
String pathPrefix = crudRequestMapping.value();
|
||||
if (StrUtil.isNotBlank(pathPrefix)) {
|
||||
/**
|
||||
* 问题:RequestMappingInfo.paths(pathPrefix)返回的RequestMappingInfo对象里pathPatternsCondition = null
|
||||
* 导致combine()方法抛出断言异常!
|
||||
* 修复: 创建options对象, 并设置PatternParser
|
||||
/*
|
||||
* 问题:RequestMappingInfo.paths(pathPrefix) 返回的 RequestMappingInfo 对象里 pathPatternsCondition = null
|
||||
* 导致 combine() 方法抛出断言异常! 修复:创建 options 对象,并设置 PatternParser
|
||||
*/
|
||||
RequestMappingInfo.BuilderConfiguration options = new RequestMappingInfo.BuilderConfiguration();
|
||||
options.setPatternParser(PathPatternParser.defaultInstance);
|
||||
requestMappingInfo = RequestMappingInfo.paths(pathPrefix).options(options).build().combine(requestMappingInfo);
|
||||
requestMappingInfo =
|
||||
RequestMappingInfo.paths(pathPrefix).options(options).build().combine(requestMappingInfo);
|
||||
}
|
||||
|
||||
// 过滤 API
|
||||
|
@ -218,8 +218,8 @@ public class LogInterceptor implements HandlerInterceptor {
|
||||
logDO.setRequestHeaders(this.desensitize(JakartaServletUtil.getHeaderMap(request)));
|
||||
String requestBody = this.getRequestBody(request);
|
||||
if (StrUtil.isNotBlank(requestBody)) {
|
||||
logDO.setRequestBody(this.desensitize(
|
||||
JSONUtil.isTypeJSON(requestBody) ? JSONUtil.parseObj(requestBody) : JakartaServletUtil.getParamMap(request)));
|
||||
logDO.setRequestBody(this.desensitize(JSONUtil.isTypeJSON(requestBody) ? JSONUtil.parseObj(requestBody)
|
||||
: JakartaServletUtil.getParamMap(request)));
|
||||
}
|
||||
logDO.setClientIp(JakartaServletUtil.getClientIP(request));
|
||||
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.StpLogic;
|
||||
import cn.dev33.satoken.stp.StpUtil;
|
||||
import top.charles7c.cnadmin.auth.config.satoken.properties.SecurityProperties;
|
||||
|
||||
/**
|
||||
* Sa-Token 配置
|
||||
|
@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package top.charles7c.cnadmin.auth.config.satoken.properties;
|
||||
package top.charles7c.cnadmin.auth.config.satoken;
|
||||
|
||||
import lombok.Data;
|
||||
|
@ -52,14 +52,14 @@ public class MenuController extends BaseController<MenuService, MenuVO, MenuVO,
|
||||
|
||||
@Override
|
||||
@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);
|
||||
return super.add(request);
|
||||
}
|
||||
|
||||
@Override
|
||||
@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);
|
||||
return super.update(request, id);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ spring:
|
||||
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
|
||||
username: ${DB_USER:root}
|
||||
password: ${DB_PWD:root}
|
||||
password: ${DB_PWD:123456}
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
# 从库配置(可配多个,构成多从)
|
||||
slave_1:
|
||||
@ -60,7 +60,7 @@ spring:
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
# password: ${REDIS_PWD:123456}
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
|
@ -53,19 +53,20 @@ spring.liquibase:
|
||||
|
||||
--- ### Redis 单机配置
|
||||
spring:
|
||||
redis:
|
||||
# 地址
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启 SSL
|
||||
ssl: false
|
||||
data:
|
||||
redis:
|
||||
# 地址
|
||||
host: ${REDIS_HOST:127.0.0.1}
|
||||
# 端口(默认 6379)
|
||||
port: ${REDIS_PORT:6379}
|
||||
# 密码(未设置密码时可为空或注释掉)
|
||||
password: ${REDIS_PWD:123456}
|
||||
# 数据库索引
|
||||
database: ${REDIS_DB:0}
|
||||
# 连接超时时间
|
||||
timeout: 10s
|
||||
# 是否开启 SSL
|
||||
ssl: false
|
||||
|
||||
--- ### 邮件配置
|
||||
spring:
|
||||
|
@ -188,6 +188,13 @@ spring:
|
||||
# 允许反序列化不存在的属性
|
||||
FAIL_ON_UNKNOWN_PROPERTIES: false
|
||||
|
||||
--- ### 健康检查配置
|
||||
management:
|
||||
health:
|
||||
mail:
|
||||
# 关闭邮箱健康检查(邮箱配置错误或邮箱服务器不可用时,健康检查会报错)
|
||||
enabled: false
|
||||
|
||||
--- ### 线程池配置
|
||||
thread-pool:
|
||||
# 是否启用线程池
|
||||
@ -195,23 +202,4 @@ thread-pool:
|
||||
# 队列容量
|
||||
queueCapacity: 128
|
||||
# 活跃时间
|
||||
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
|
||||
keepAliveSeconds: 300
|
Loading…
Reference in New Issue
Block a user