main
kzkzzzz 2024-06-12 10:30:18 +08:00
parent 8f16a44e73
commit 9f7bb206f7
2 changed files with 4 additions and 2 deletions

View File

@ -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))

View File

@ -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 != "" {