blob: 7973df9d7869bbb363ac55ed3c865d91d3efef70 [file] [log] [blame]
Jiarenxiang25a45b72025-03-13 16:09:13 +08001# 项目相关配置
2ruoyi:
3 # 名称
meisiyuc98fc522025-06-02 20:33:40 +08004 name: ThunderHub
Jiarenxiang25a45b72025-03-13 16:09:13 +08005 # 版本
meisiyuc98fc522025-06-02 20:33:40 +08006 version: 1.0.0
Jiarenxiang25a45b72025-03-13 16:09:13 +08007 # 版权年份
8 copyrightYear: 2024
meisiyuc98fc522025-06-02 20:33:40 +08009 # 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
10 profile: ./upload
11 # 前端项目图片路径(相对于后端项目根目录)
12 frontendImagePath: ../ThunderHubWeb/public/images
Jiarenxiang25a45b72025-03-13 16:09:13 +080013 # 获取ip地址开关
14 addressEnabled: false
meisiyuc98fc522025-06-02 20:33:40 +080015 # 验证码类型 math 数组计算 char 字符验证
Jiarenxiang25a45b72025-03-13 16:09:13 +080016 captchaType: math
17
18# 开发环境配置
19server:
20 # 服务器的HTTP端口,默认为8080
liangjiabao5a1a7632025-06-05 18:49:18 +080021 port: 5004
Jiarenxiang25a45b72025-03-13 16:09:13 +080022 servlet:
23 # 应用的访问路径
24 context-path: /
25 tomcat:
26 # tomcat的URI编码
27 uri-encoding: UTF-8
28 # 连接数满后的排队数,默认为100
29 accept-count: 1000
30 threads:
31 # tomcat最大线程数,默认为200
32 max: 800
33 # Tomcat启动初始化的线程数,默认值10
34 min-spare: 100
Jiarenxiang5f4247d2025-06-06 18:10:35 +080035 hostname: "192.168.146.1"
Jiarenxiang25a45b72025-03-13 16:09:13 +080036
37# 日志配置
38logging:
39 level:
40 com.ruoyi: debug
41 org.springframework: warn
42
43# 用户配置
44user:
45 password:
46 # 密码最大错误次数
47 maxRetryCount: 5
48 # 密码锁定时间(默认10分钟)
49 lockTime: 10
50
51# Spring配置
52spring:
Jiarenxiang96e467e2025-06-06 20:29:46 +080053 datasource:
54 type: com.alibaba.druid.pool.DruidDataSource
55 driverClassName: com.mysql.cj.jdbc.Driver
56 url: jdbc:mysql://202.205.102.121:3306/ThunderHub?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
57 username: team4
58 password: woaizhaoyutao
59 druid:
60 # 初始连接数
61 initialSize: 5
62 # 最小连接池数量
63 minIdle: 10
64 # 最大连接池数量
65 maxActive: 20
66 # 配置获取连接等待超时的时间
67 maxWait: 60000
68 # 配置连接超时时间
69 connectTimeout: 30000
70 # 配置网络超时时间
71 socketTimeout: 60000
72 # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
73 timeBetweenEvictionRunsMillis: 60000
74 # 配置一个连接在池中最小生存的时间,单位是毫秒
75 minEvictableIdleTimeMillis: 300000
76 # 配置一个连接在池中最大生存的时间,单位是毫秒
77 maxEvictableIdleTimeMillis: 900000
78 # 配置检测连接是否有效
79 validationQuery: SELECT 1 FROM DUAL
80 testWhileIdle: true
81 testOnBorrow: false
82 testOnReturn: false
83 webStatFilter:
84 enabled: true
85 statViewServlet:
86 enabled: true
87 # 设置白名单,不填则允许所有访问
88 allow:
89 url-pattern: /druid/*
90 # 控制台管理用户名和密码
91 login-username: ruoyi
92 login-password: 123456
93 filter:
94 stat:
95 enabled: true
96 # 慢SQL记录
97 log-slow-sql: true
98 slow-sql-millis: 1000
99 merge-sql: true
100 wall:
101 config:
102 multi-statement-allow: true
Jiarenxiang5f4247d2025-06-06 18:10:35 +0800103 jpa:
104 show-sql: true
105 properties:
106 hibernate:
107 format_sql: true
108 flyway:
109 enabled: false # 禁用Flyway
Jiarenxiang25a45b72025-03-13 16:09:13 +0800110 # 资源信息
111 messages:
112 # 国际化资源文件路径
113 basename: i18n/messages
Jiarenxiang25a45b72025-03-13 16:09:13 +0800114 # 文件上传
115 servlet:
116 multipart:
Jiarenxiang5f4247d2025-06-06 18:10:35 +0800117 # 单个文件大小
崔向南03d21b92025-06-05 17:42:23 +0800118 enabled: true
Jiarenxiang5f4247d2025-06-06 18:10:35 +0800119 max-file-size: 100MB
120
Jiarenxiang25a45b72025-03-13 16:09:13 +0800121 # 设置总上传的文件大小
Jiarenxiang5f4247d2025-06-06 18:10:35 +0800122 max-request-size: 1024MB
Jiarenxiang25a45b72025-03-13 16:09:13 +0800123 # 服务模块
124 devtools:
125 restart:
126 # 热部署开关
127 enabled: true
崔向南03d21b92025-06-05 17:42:23 +0800128 mvc:
129 static-path-pattern: /**
130 resources:
131 static-locations: file:uploads/
Jiarenxiang25a45b72025-03-13 16:09:13 +0800132
133# token配置
134token:
135 # 令牌自定义标识
136 header: Authorization
137 # 令牌密钥
138 secret: abcdefghijklmnopqrstuvwxyz
139 # 令牌有效期(默认30分钟)
140 expireTime: 30
141
Jiarenxiang25a45b72025-03-13 16:09:13 +0800142
143# MyBatis-plus配置
144mybatis-plus:
145 # 搜索指定包别名
146 typeAliasesPackage: com.ruoyi.**.domain
Jiarenxiang5f4247d2025-06-06 18:10:35 +0800147
崔向南03d21b92025-06-05 17:42:23 +0800148 # 重点修改2:覆盖原路径,支持多模块
149 mapper-locations: classpath*:mapper/**/*.xml
Jiarenxiang25a45b72025-03-13 16:09:13 +0800150 configLocation: classpath:mybatis/mybatis-config.xml
151 # 全局配置
152 global-config:
153 # 主键类型 0:"数据库ID自增", 1:"用户输入ID",2:"全局唯一ID (数字类型唯一ID)", 3:"全局唯一ID UUID";
154 id-type: 0
155 # 字段策略 0:"忽略判断",1:"非 NULL 判断"),2:"非空判断"
156 field-strategy: 2
157 # 驼峰下划线转换
158 db-column-underline: true
159 # 刷新mapper 调试神器
160 refresh-mapper: true
崔向南03d21b92025-06-05 17:42:23 +0800161 # 重点修改3:明确开启驼峰映射
Jiarenxiang25a45b72025-03-13 16:09:13 +0800162 configuration:
163 # 驼峰式命名
164 map-underscore-to-camel-case: true
165 # 全局映射器启用缓存
166 cache-enabled: true
167 # 指定 MyBatis 所用日志的具体实现
168 log-impl: org.slf4j;
169 # 配置默认的执行器
170 default-executor-type: reuse
171 # 允许 JDBC 支持自动生成主键
172 use-generated-keys: true
173
崔向南03d21b92025-06-05 17:42:23 +0800174# 新增文件上传路径配置(放在末尾)
175file:
176 upload-dir: /var/www/uploads/
Jiarenxiang25a45b72025-03-13 16:09:13 +0800177
178# PageHelper分页插件
179pagehelper:
180 helperDialect: mysql
181 supportMethodsArguments: true
182 params: count=countSql
183
184# Springdoc配置
185springdoc:
186 api-docs:
187 path: /v3/api-docs
188 swagger-ui:
189 enabled: true
190 path: /swagger-ui.html
191 tags-sorter: alpha
192 group-configs:
193 - group: 'default'
194 display-name: '测试模块'
195 paths-to-match: '/**'
196 packages-to-scan: com.ruoyi.web.controller.tool
197
198# 防止XSS攻击
199xss:
200 # 过滤开关
201 enabled: true
202 # 排除链接(多个用逗号分隔)
203 excludes: /system/notice
204 # 匹配链接
205 urlPatterns: /system/*,/monitor/*,/tool/*
206
207# 设置是否调试,调试情况可跳过接口认证
208debug: false
Jiarenxiang5f4247d2025-06-06 18:10:35 +0800209
210