Update session.go

pull/466/head
GuerraMorgan 5 years ago committed by GitHub
parent 8ef61bc1dd
commit 25b204f610
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,7 +18,7 @@ func Session(secret string) gin.HandlerFunc {
// Redis设置不为空且非测试模式时使用Redis // Redis设置不为空且非测试模式时使用Redis
if conf.RedisConfig.Server != "" && gin.Mode() != gin.TestMode { if conf.RedisConfig.Server != "" && gin.Mode() != gin.TestMode {
var err error var err error
Store, err = redis.NewStoreWithDB(10, "tcp", conf.RedisConfig.Server, conf.RedisConfig.Password, conf.RedisConfig.DB, []byte(secret)) Store, err = redis.NewStoreWithDB(10, conf.RedisConfig.Network, conf.RedisConfig.Server, conf.RedisConfig.Password, conf.RedisConfig.DB, []byte(secret))
if err != nil { if err != nil {
util.Log().Panic("无法连接到 Redis%s", err) util.Log().Panic("无法连接到 Redis%s", err)
} }

Loading…
Cancel
Save