From 8fbfaa6d1f79487a7149aef02d2dbfb2556cb4bf Mon Sep 17 00:00:00 2001 From: zhangwenjian Date: Mon, 27 Jul 2020 22:44:01 +0800 Subject: [PATCH] config : update config --- models/tools/dbcolumns.go | 4 ++-- models/tools/dbtables.go | 6 +++--- router/initrouter.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/models/tools/dbcolumns.go b/models/tools/dbcolumns.go index d5b29243..de4f509b 100644 --- a/models/tools/dbcolumns.go +++ b/models/tools/dbcolumns.go @@ -30,7 +30,7 @@ func (e *DBColumns) GetPage(pageSize int, pageIndex int) ([]DBColumns, int, erro if config2.DatabaseConfig.Driver == "mysql" { table = orm.Eloquent.Select("*").Table("information_schema.`COLUMNS`") - table = table.Where("table_schema= ? ", config2.DatabaseConfig.DBName) + table = table.Where("table_schema= ? ", config2.GenConfig.DBName) if e.TableName != "" { return nil, 0, errors.New("table name cannot be empty!") @@ -57,7 +57,7 @@ func (e *DBColumns) GetList() ([]DBColumns, error) { if config2.DatabaseConfig.Driver == "mysql" { table = orm.Eloquent.Select("*").Table("information_schema.columns") - table = table.Where("table_schema= ? ", config2.DatabaseConfig.DBName) + table = table.Where("table_schema= ? ", config2.GenConfig.DBName) table = table.Where("TABLE_NAME = ?", e.TableName) } else { diff --git a/models/tools/dbtables.go b/models/tools/dbtables.go index fa7d6a3f..c0a84b32 100644 --- a/models/tools/dbtables.go +++ b/models/tools/dbtables.go @@ -25,8 +25,8 @@ func (e *DBTables) GetPage(pageSize int, pageIndex int) ([]DBTables, int, error) if config2.DatabaseConfig.Driver == "mysql" { table = orm.Eloquent.Select("*").Table("information_schema.tables") - table = table.Where("TABLE_NAME not in (select table_name from " + config2.DatabaseConfig.DBName + ".sys_tables) ") - table = table.Where("table_schema= ? ", config2.DatabaseConfig.DBName) + table = table.Where("TABLE_NAME not in (select table_name from " + config2.GenConfig.DBName + ".sys_tables) ") + table = table.Where("table_schema= ? ", config2.GenConfig.DBName) if e.TableName != "" { table = table.Where("TABLE_NAME = ?", e.TableName) @@ -47,7 +47,7 @@ func (e *DBTables) Get() (DBTables, error) { table := new(gorm.DB) if config2.DatabaseConfig.Driver == "mysql" { table = orm.Eloquent.Select("*").Table("information_schema.tables") - table = table.Where("table_schema= ? ", config2.DatabaseConfig.DBName) + table = table.Where("table_schema= ? ", config2.GenConfig.DBName) if e.TableName == "" { return doc, errors.New("table name cannot be empty!") } diff --git a/router/initrouter.go b/router/initrouter.go index 47936e06..3fa54a2c 100644 --- a/router/initrouter.go +++ b/router/initrouter.go @@ -12,7 +12,7 @@ import ( func InitRouter() *gin.Engine { r := gin.New() - if config2.ApplicationConfig.IsHttps { + if config2.SslConfig.Enable { r.Use(handler.TlsHandler()) } middleware.InitMiddleware(r) @@ -24,7 +24,7 @@ func InitRouter() *gin.Engine { InitSysRouter(r, authMiddleware) // 注册业务路由 - // TODO: 这里可存放业务路由,里边并无实际路由是有演示代码 + // TODO: 这里可存放业务路由,里边并无实际路由只有演示代码 InitExamplesRouter(r, authMiddleware) return r