ebike-plus/ebike-gateway/src/main/resources/application-prod.yml

131 lines
3.8 KiB
YAML
Raw Normal View History

2026-01-13 16:54:25 +08:00
server:
port: 10010
spring:
application:
name: ebike-gateway
servlet:
multipart:
max-file-size: 30MB
max-request-size: 100MB
file-size-threshold: 0B
jackson:
serialization:
write-dates-as-timestamps: false
date-format: yyyy-MM-dd HH:mm:ss
time-zone: GMT+8
cloud:
nacos:
server-addr: 47.109.141.125:8848 # nacos
username: nacos
password: 970529
gateway:
# 跨域配置
globalcors:
cors-configurations:
'[/**]': # 允许跨域访问的资源
allowedOriginPatterns: "*" #跨域允许来源
allowedHeaders: "*"
allowedMethods: "*"
allowCredentials: true
maxAge: 360000
routes:
- id: ebike-gather # 路由标示,必须唯一
uri: lb://ebike-gather # 路由的目标地址
predicates: # 路由断言,判断请求是否符合规则
- Path=/gather/** # 路径断言,判断路径是否是以/wuyu开头如果是则符合
- id: ebike-staff
uri: lb://ebike-staff
predicates:
- Path=/staff/**
filters:
- StripPrefix=1 # 去掉/user/部分
- id: ebike-operations
uri: lb://ebike-operations
predicates:
- Path=/operations/**
filters:
- StripPrefix=1
- id: ebike-user
uri: lb://ebike-user
predicates:
- Path=/user/**
filters:
- StripPrefix=1
- id: ebike-payment
uri: lb://ebike-payment
predicates:
- Path=/payment/**
filters:
- StripPrefix=1
data:
# redis配置
redis:
# Redis数据库索引默认为0
database: 1
# Redis服务器地址
host: 47.109.141.125
# Redis服务器连接端口
port: 6379
# Redis服务器连接密码默认为空
password: 970529
# 连接超时时间
lettuce:
pool:
# 连接池最大连接数
max-active: 200
# 连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 连接池中的最大空闲连接
max-idle: 10
# 连接池中的最小空闲连接
min-idle: 0
############## Sa-Token 配置 (文档: https://sa-token.cc) ##############
sa-token:
# token 名称(同时也是 cookie 名称)
token-name: Authorization
# token 有效期(单位:秒) 默认30天-1 代表永久有效
timeout: 2592000
# token 最低活跃频率(单位:秒),如果 token 超过此时间没有访问系统就会被冻结,默认-1 代表不限制,永不冻结
active-timeout: -1
# 是否允许同一账号多地同时登录 (为 true 时允许一起登录, 为 false 时新登录挤掉旧登录)
is-concurrent: false
# 在多人登录同一账号时,是否共用一个 token (为 true 时所有登录共用一个 token, 为 false 时每次登录新建一个 token
is-share: false
# token 风格默认可取值uuid、simple-uuid、random-32、random-64、random-128、tik
token-style: random-32
# 是否输出操作日志
is-log: true
# 开启检查的登陆状态的开关
is-check: true
2026-02-10 16:39:59 +08:00
# 需要被拦截的接口列表
user:
auth:
# 需要 token 校验的路径列表
required-paths:
- /user/ebikeOrder/api/updateOrderAmount
2026-01-13 16:54:25 +08:00
# 自定义加解密配置
cdzy:
gateway:
secure:
request-switch:
enable: false
response-switch:
enable: false
management:
endpoints:
web:
exposure:
include: health,info
endpoint:
health:
show-details: always
logging:
file:
name: /app/logs/${spring.application.name}.log
pattern:
dateformat: yyyy-MM-dd HH:mm:ss.SSS # 包含毫秒