【EasyPan】application.properties配置文件解析

【EasyPan】项目常见问题解答(自用&持续更新中…)汇总版

EasyPan 配置文件解析

一、Web服务配置

应用服务端口配置
server.port=7090  # 使用7090非标准端口,避免与常见服务冲突
server.servlet.context-path=/api  # 所有API接口统一前缀

Session管理
server.servlet.session.timeout=PT60M  # Session有效期60分钟(ISO-8601格式)

静态资源处理
spring.mvc.favicon.enable=false  # 禁用默认favicon.ico请求

二、文件上传配置

文件上传限制(需根据业务需求调整)
spring.servlet.multipart.max-file-size=15MB  # 单个文件最大15MB
spring.servlet.multipart.max-request-size=15MB  # 单次请求总量限制

异常处理策略
spring.mvc.throw-exception-if-no-handler-found=true  # 启用404异常抛出
spring.web.resources.add-mappings=false  # 禁用默认资源映射

三、数据库配置(HikariCP连接池)

MySQL连接配置(含中文编码和时区设置)
spring.datasource.url=jdbc:mysql://localhost:3306/easypan?serverTimezone=GMT%2B8&useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false

数据库凭证(生产环境应加密)
spring.datasource.username=root
spring.datasource.password=root  # 警告:生产环境必须修改

HikariCP连接池优化配置
spring.datasource.hikari.minimum-idle=5  # 最小空闲连接数
spring.datasource.hikari.maximum-pool-size=10  # 最大连接数
spring.datasource.hikari.idle-timeout=180000  # 空闲连接超时(ms)
spring.datasource.hikari.max-lifetime=1800000  # 连接最大存活时间

四、邮件服务配置(QQ SMTP)

QQ邮箱SMTP服务配置
spring.mail.host=smtp.qq.com  # SMTP服务器地址
spring.mail.port=465  # SSL加密端口

邮箱账号凭证(严重敏感信息)
spring.mail.username=test@qq.com
spring.mail.password=xxxxxxxxx  # 此为授权码非密码

SSL安全配置
spring.mail.properties.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
spring.mail.properties.mail.debug=true  # 开发调试模式

五、Redis缓存配置

Redis基础配置
spring.redis.database=0  # 使用0号数据库
spring.redis.host=127.0.0.1
spring.redis.port=6379

Jedis连接池配置
spring.redis.jedis.pool.max-active=20  # 最大活跃连接数
spring.redis.timeout=2000  # 操作超时时间(毫秒)

六、业务系统配置

文件存储路径(Windows环境)
project.folder=D:/work-webser/myapps/easypan/

日志级别设置
log.root.level=debug  # 开发调试级别

管理员配置
admin.emails=test@qq.com  # 超级管理员邮箱

环境标识
dev=false  # 生产环境标志

七、QQ登录OAuth2配置

QQ互联应用凭证
qq.app.id=12333  # 应用ID(需在QQ互联平台申请)
qq.app.key=2222222  # 应用密钥

OAuth2认证端点
qq.url.authorization=https://graph.qq.com/oauth2.0/authorize?response_type=code...
qq.url.access.token=https://graph.qq.com/oauth2.0/token?grant_type=authorization_code...
qq.url.redirect=http://easypan.wuhancoder.com/qqlogincalback  # 回调地址
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值