mirror of
https://gitee.com/XM-GO/PandaX.git
synced 2026-04-23 02:48:34 +08:00
【修改】配置文件参数说明
This commit is contained in:
@@ -36,6 +36,6 @@ type Tls struct {
|
||||
}
|
||||
|
||||
type Rate struct {
|
||||
IsRate bool `yaml:"is-rate"` // 是否限流
|
||||
Enable bool `yaml:"enable"` // 是否限流
|
||||
RateNum float64 `yaml:"rate-num"` // 限流数量
|
||||
}
|
||||
|
||||
@@ -7,10 +7,12 @@ server:
|
||||
model: release
|
||||
port: 7788
|
||||
cors: true
|
||||
# 接口限流
|
||||
rate:
|
||||
is-rate: true
|
||||
enable: true
|
||||
rate-num: 100
|
||||
db-type: mysql
|
||||
# 是否开启数据库表初始化
|
||||
isInitTable: false
|
||||
excel-dir: ./resource/excel/
|
||||
tls:
|
||||
@@ -40,7 +42,7 @@ redis:
|
||||
port: 6379
|
||||
|
||||
mysql:
|
||||
host: 47.104.252.2:3306
|
||||
host: 127.0.0.1:3306
|
||||
username: pandax
|
||||
password: pandax
|
||||
db-name: pandax
|
||||
|
||||
@@ -52,7 +52,7 @@ func InitRouter() *gin.Engine {
|
||||
router.Use(middleware.Cors())
|
||||
}
|
||||
// 流量限制
|
||||
if serverConfig.Rate.IsRate {
|
||||
if serverConfig.Rate.Enable {
|
||||
router.Use(middleware.Rate())
|
||||
}
|
||||
// api接口
|
||||
|
||||
Reference in New Issue
Block a user