mirror of
https://github.com/cloudreve/cloudreve.git
synced 2025-10-27 10:36:12 +08:00
i18n: logs in bootstrapper and response code in middleware
This commit is contained in:
@ -20,10 +20,10 @@ func Session(secret string) gin.HandlerFunc {
|
||||
var err error
|
||||
Store, err = redis.NewStoreWithDB(10, conf.RedisConfig.Network, conf.RedisConfig.Server, conf.RedisConfig.Password, conf.RedisConfig.DB, []byte(secret))
|
||||
if err != nil {
|
||||
util.Log().Panic("无法连接到 Redis:%s", err)
|
||||
util.Log().Panic("Failed to connect to Redis:%s", err)
|
||||
}
|
||||
|
||||
util.Log().Info("已连接到 Redis 服务器:%s", conf.RedisConfig.Server)
|
||||
util.Log().Info("Connect to Redis server %q.", conf.RedisConfig.Server)
|
||||
} else {
|
||||
Store = memstore.NewStore([]byte(secret))
|
||||
}
|
||||
@ -50,7 +50,7 @@ func CSRFCheck() gin.HandlerFunc {
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(200, serializer.Err(serializer.CodeNoPermissionErr, "来源非法", nil))
|
||||
c.JSON(200, serializer.Err(serializer.CodeNoPermissionErr, "Invalid origin", nil))
|
||||
c.Abort()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user