|
|
server:
|
|
|
# undertow 配置
|
|
|
undertow:
|
|
|
# HTTP post内容的最大大小。当值为-1时,默认值为大小是无限的
|
|
|
max-http-post-size: -1
|
|
|
# 以下的配置会影响buffer,这些buffer会用于服务器连接的IO操作,有点类似netty的池化内存管理
|
|
|
# 每块buffer的空间大小,越小的空间被利用越充分
|
|
|
buffer-size: 512
|
|
|
# 是否分配的直接内存
|
|
|
direct-buffers: true
|
|
|
threads:
|
|
|
# 设置IO线程数, 它主要执行非阻塞的任务,它们会负责多个连接, 默认设置每个CPU核心一个线程
|
|
|
io: 8
|
|
|
# 阻塞任务线程池, 当执行类似servlet请求阻塞操作, undertow会从这个线程池中取得线程,它的值设置取决于系统的负载
|
|
|
worker: 256
|
|
|
|
|
|
dubbo:
|
|
|
application:
|
|
|
logger: slf4j
|
|
|
protocol:
|
|
|
# 使用dubbo协议通信
|
|
|
name: dubbo
|
|
|
# dubbo 协议端口(-1表示自增端口,从20880开始)
|
|
|
port: -1
|
|
|
# 注册中心配置
|
|
|
registry:
|
|
|
address: nacos://${spring.cloud.nacos.server-addr}
|
|
|
group: DUBBO_GROUP
|
|
|
# 消费者相关配置
|
|
|
consumer:
|
|
|
# 结果缓存(LRU算法)
|
|
|
cache: true
|
|
|
# 支持校验注解
|
|
|
validation: true
|
|
|
# 超时时间
|
|
|
timeout: 3000
|
|
|
# 初始化检查
|
|
|
check: false
|
|
|
scan:
|
|
|
# 接口实现类扫描
|
|
|
base-packages: com.ruoyi.**.dubbo
|
|
|
# 自定义配置
|
|
|
custom:
|
|
|
# 全局请求log
|
|
|
request-log: true
|
|
|
|
|
|
spring:
|
|
|
main:
|
|
|
allow-bean-definition-overriding: true
|
|
|
#jackson配置
|
|
|
jackson:
|
|
|
# 日期格式化
|
|
|
date-format: yyyy-MM-dd HH:mm:ss
|
|
|
serialization:
|
|
|
# 格式化输出
|
|
|
indent_output: false
|
|
|
# 忽略无法转换的对象
|
|
|
fail_on_empty_beans: false
|
|
|
deserialization:
|
|
|
# 允许对象忽略json中不存在的属性
|
|
|
fail_on_unknown_properties: false
|
|
|
cloud:
|
|
|
# 网关配置
|
|
|
gateway:
|
|
|
discovery:
|
|
|
locator:
|
|
|
lowerCaseServiceId: true
|
|
|
enabled: true
|
|
|
routes:
|
|
|
# 认证中心
|
|
|
- id: ruoyi-auth
|
|
|
uri: lb://ruoyi-auth
|
|
|
predicates:
|
|
|
- Path=/auth/**
|
|
|
filters:
|
|
|
# 验证码处理
|
|
|
- CacheRequestFilter
|
|
|
- ValidateCodeFilter
|
|
|
- StripPrefix=1
|
|
|
# 代码生成
|
|
|
- id: ruoyi-gen
|
|
|
uri: lb://ruoyi-gen
|
|
|
predicates:
|
|
|
- Path=/code/**
|
|
|
filters:
|
|
|
- StripPrefix=1
|
|
|
# 定时任务
|
|
|
- id: ruoyi-job
|
|
|
uri: lb://ruoyi-job
|
|
|
predicates:
|
|
|
- Path=/schedule/**
|
|
|
filters:
|
|
|
- StripPrefix=1
|
|
|
# 系统模块
|
|
|
- id: ruoyi-system
|
|
|
uri: lb://ruoyi-system
|
|
|
predicates:
|
|
|
- Path=/system/**
|
|
|
filters:
|
|
|
- StripPrefix=1
|
|
|
# 文件服务
|
|
|
- id: ruoyi-file
|
|
|
uri: lb://ruoyi-file
|
|
|
predicates:
|
|
|
- Path=/file/**
|
|
|
filters:
|
|
|
- StripPrefix=1
|
|
|
|
|
|
# 安全配置
|
|
|
security:
|
|
|
# 验证码
|
|
|
captcha:
|
|
|
# 是否开启验证码
|
|
|
enabled: true
|
|
|
# 验证码类型 math 数组计算 char 字符验证
|
|
|
type: MATH
|
|
|
# line 线段干扰 circle 圆圈干扰 shear 扭曲干扰
|
|
|
category: CIRCLE
|
|
|
# 数字验证码位数
|
|
|
numberLength: 1
|
|
|
# 字符验证码长度
|
|
|
charLength: 4
|
|
|
# 防止XSS攻击
|
|
|
xss:
|
|
|
enabled: true
|
|
|
excludeUrls:
|
|
|
- /system/notice
|
|
|
# 不校验白名单
|
|
|
ignore:
|
|
|
whites:
|
|
|
- /auth/logout
|
|
|
- /auth/login
|
|
|
- /auth/register
|
|
|
- /*/v2/api-docs
|
|
|
- /csrf
|
|
|
|
|
|
# 暴露监控端点
|
|
|
management:
|
|
|
endpoints:
|
|
|
web:
|
|
|
exposure:
|
|
|
include: '*'
|
|
|
endpoint:
|
|
|
logfile:
|
|
|
external-file: ./logs/${spring.application.name}/console.log
|
|
|
|
|
|
# 日志配置
|
|
|
logging:
|
|
|
level:
|
|
|
org.springframework: warn
|
|
|
org.apache.dubbo: warn
|
|
|
com.alibaba.nacos: warn
|
|
|
config: classpath:logback.xml
|
|
|
|
|
|
# redisson 缓存配置
|
|
|
redisson:
|
|
|
cacheGroup:
|
|
|
# 用例: @Cacheable(cacheNames="groupId", key="#XXX") 方可使用缓存组配置
|
|
|
- groupId: redissonCacheMap
|
|
|
# 组过期时间(脚本监控)
|
|
|
ttl: 60000
|
|
|
# 组最大空闲时间(脚本监控)
|
|
|
maxIdleTime: 60000
|
|
|
# 组最大长度
|
|
|
maxSize: 0
|
|
|
|
|
|
# 分布式锁 lock4j 全局配置
|
|
|
lock4j:
|
|
|
# 获取分布式锁超时时间,默认为 3000 毫秒
|
|
|
acquire-timeout: 3000
|
|
|
# 分布式锁的超时时间,默认为 30 毫秒
|
|
|
expire: 30000
|
|
|
|
|
|
# mybatis配置
|
|
|
mybatis:
|
|
|
# 搜索指定包别名
|
|
|
typeAliasesPackage: com.ruoyi.**.domain
|
|
|
# 配置mapper的扫描,找到所有的mapper.xml映射文件
|
|
|
mapperLocations: classpath:mapper/**/*.xml
|
|
|
|
|
|
# swagger配置
|
|
|
swagger:
|
|
|
license: Powered By ruoyi
|
|
|
licenseUrl: https://ruoyi.vip
|