Skip to content

Commit e2d9cfc

Browse files
author
piexlmax
committed
增加主动使用redis的配置
1 parent 9c41ed8 commit e2d9cfc

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

server/config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ system:
4343
addr: 8888
4444
db-type: 'mysql'
4545
oss-type: 'local' # 控制oss选择走本地还是 七牛等其他仓 自行增加其他oss仓可以在 server/utils/upload/upload.go 中 NewOss函数配置
46+
use-redis: false # 使用redis
4647
use-multipoint: false
4748
# IP限制次数 一个小时15000次
4849
iplimit-count: 15000

server/config/system.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ type System struct {
66
DbType string `mapstructure:"db-type" json:"dbType" yaml:"db-type"` // 数据库类型:mysql(默认)|sqlite|sqlserver|postgresql
77
OssType string `mapstructure:"oss-type" json:"ossType" yaml:"oss-type"` // Oss类型
88
UseMultipoint bool `mapstructure:"use-multipoint" json:"useMultipoint" yaml:"use-multipoint"` // 多点登录拦截
9+
UseRedis bool `mapstructure:"use-redis" json:"useRedis" yaml:"use-redis"` // 使用redis
910
LimitCountIP int `mapstructure:"iplimit-count" json:"iplimitCount" yaml:"iplimit-count"`
1011
LimitTimeIP int `mapstructure:"iplimit-time" json:"iplimitTime" yaml:"iplimit-time"`
1112
}

server/core/server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type server interface {
1515
}
1616

1717
func RunWindowsServer() {
18-
if global.GVA_CONFIG.System.UseMultipoint {
18+
if global.GVA_CONFIG.System.UseMultipoint || global.GVA_CONFIG.System.UseRedis {
1919
// 初始化redis服务
2020
initialize.Redis()
2121
}

0 commit comments

Comments
 (0)