From 9f7bb206f703726ca9d4cc40d312d9c67ff04774 Mon Sep 17 00:00:00 2001 From: kzkzzzz Date: Wed, 12 Jun 2024 10:30:18 +0800 Subject: [PATCH] update --- app/db/db.go | 2 +- main.go | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/db/db.go b/app/db/db.go index a254e18..a76929d 100644 --- a/app/db/db.go +++ b/app/db/db.go @@ -11,7 +11,7 @@ var ( ) func InitAdminDb() { - dsn := `admin1:XUztIJWW!sr6bJqWK85CJ7kN@tcp(172.28.16.6:3306)/new_admin?charset=utf8&parseTime=true&loc=Asia%2FShanghai` // 保存sql记录的数据库连接 + dsn := `root:admin123@tcp(127.0.0.1:3306)/main?charset=utf8&parseTime=true&loc=Asia%2FShanghai` // 保存sql记录的数据库连接 var err error db, err = gorm.Open(mysql.Open(dsn)) diff --git a/main.go b/main.go index 764341b..3bba619 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,9 @@ func main() { zlog.Infof("server version: %s", conf.App.ServerVersion) zlog.Infof("remote db: %s", conf.App.RemoteDb) - db.InitAdminDb() + if conf.App.SaveLog { + db.InitAdminDb() + } // todb if conf.App.WebAddr != "" {