update
parent
8f16a44e73
commit
9f7bb206f7
|
@ -11,7 +11,7 @@ var (
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitAdminDb() {
|
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
|
var err error
|
||||||
db, err = gorm.Open(mysql.Open(dsn))
|
db, err = gorm.Open(mysql.Open(dsn))
|
||||||
|
|
2
main.go
2
main.go
|
@ -32,7 +32,9 @@ func main() {
|
||||||
zlog.Infof("server version: %s", conf.App.ServerVersion)
|
zlog.Infof("server version: %s", conf.App.ServerVersion)
|
||||||
zlog.Infof("remote db: %s", conf.App.RemoteDb)
|
zlog.Infof("remote db: %s", conf.App.RemoteDb)
|
||||||
|
|
||||||
|
if conf.App.SaveLog {
|
||||||
db.InitAdminDb()
|
db.InitAdminDb()
|
||||||
|
}
|
||||||
|
|
||||||
// todb
|
// todb
|
||||||
if conf.App.WebAddr != "" {
|
if conf.App.WebAddr != "" {
|
||||||
|
|
Loading…
Reference in New Issue