diff --git a/backend/app.yaml b/backend/app.yaml index 16adee313..3ea59f2c8 100644 --- a/backend/app.yaml +++ b/backend/app.yaml @@ -1,6 +1,7 @@ system: port: 9999 db_type: mysql + level: debug jwt: header_name: Authorization diff --git a/backend/configs/system.go b/backend/configs/system.go index 21dbec844..302e2978c 100644 --- a/backend/configs/system.go +++ b/backend/configs/system.go @@ -3,4 +3,5 @@ package configs type System struct { Port int `mapstructure:"port"` DbType string `mapstructure:"db_type"` + Level string `mapstructure:"level"` } diff --git a/backend/init/router/router.go b/backend/init/router/router.go index d25b8fd8d..2b6edcb9c 100644 --- a/backend/init/router/router.go +++ b/backend/init/router/router.go @@ -1,8 +1,6 @@ package router import ( - "html/template" - "github.com/1Panel-dev/1Panel/docs" "github.com/1Panel-dev/1Panel/i18n" "github.com/1Panel-dev/1Panel/middleware" @@ -11,6 +9,7 @@ import ( "github.com/gin-gonic/gin" swaggerfiles "github.com/swaggo/files" ginSwagger "github.com/swaggo/gin-swagger" + "html/template" ) func Routers() *gin.Engine { diff --git a/backend/server/server.go b/backend/server/server.go index c9fcb93bb..784f55989 100644 --- a/backend/server/server.go +++ b/backend/server/server.go @@ -31,6 +31,8 @@ func Start() { cache.Init() session.Init() binary.StartTTY() + gin.SetMode(global.CONF.System.Level) + routers := router.Routers() address := fmt.Sprintf(":%d", global.CONF.System.Port) s := initServer(address, routers)