This commit is contained in:
tanghc
2020-08-28 11:34:36 +08:00
parent 8410b90001
commit 3f9365f5d5
3 changed files with 2 additions and 45 deletions

View File

@@ -1,39 +0,0 @@
# 固定不变,不能改
spring.application.name=sop-gateway
# 不用改,如果要改,请全局替换修改
sop.secret=MZZOUSTua6LzApIWXCwEgbBmxSzpzC
# 网关入口
sop.gateway-index-path=/
# nacos cloud配置
spring.cloud.nacos.discovery.server-addr=${register.url}
# 数据库配置
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.url=jdbc:mysql://${mysql.host}/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai
spring.datasource.username=${mysql.username}
spring.datasource.password=${mysql.password}
# https://blog.csdn.net/qq_36872046/article/details/81058045
# 路由转发超时时间毫秒默认值1000详见RibbonClientConfiguration.DEFAULT_READ_TIMEOUT。
# 如果微服务端 处理时间过长会导致ribbon read超时解决办法将这个值调大一点
ribbon.ReadTimeout=2000
# 设置为true默认false则所有请求都重试默认只支持get请求重试
# 请谨慎设置因为post请求大多都是写入请求如果要支持重试确保服务的幂等性
ribbon.OkToRetryOnAllOperations=false
spring.cloud.gateway.discovery.locator.lower-case-service-id=true
spring.cloud.gateway.discovery.locator.enabled=true
# 不用改
mybatis.fill.com.gitee.fastmybatis.core.support.DateFillInsert=gmt_create
mybatis.fill.com.gitee.fastmybatis.core.support.DateFillUpdate=gmt_modified
# 文件上传配置
spring.servlet.multipart.enabled=true
# 这里设置大一点没关系真实大小由upload.max-file-size控制
spring.servlet.multipart.max-file-size=50MB
# 允许上传文件大小不能超过这个值单位B,KB,MB
upload.max-file-size=2MB

View File

@@ -61,7 +61,7 @@ public class ApiValidator implements Validator {
/**
* 单个文件大小
*/
@Value("${upload.max-file-size:10MB}")
@Value("${upload.max-file-size:${spring.servlet.multipart.max-file-size:10MB}}")
private String maxFileSize;

View File

@@ -32,8 +32,4 @@ spring.codec.max-in-memory-size=262144
# 文件上传配置
spring.servlet.multipart.enabled=true
# 这里设置大一点没关系真实大小由upload.max-file-size控制
spring.servlet.multipart.max-file-size=50MB
# 允许上传文件大小不能超过这个值单位B,KB,MB
upload.max-file-size=2MB
spring.servlet.multipart.max-file-size=10MB