[FIX]修改配置文件

This commit is contained in:
2020-09-26 13:34:54 +08:00
parent 458672acd1
commit 5010beb901
3 changed files with 38 additions and 27 deletions

View File

@@ -29,13 +29,13 @@ func init() {
log.Fatal(2, "Fail to get section 'database': %v", err)
}
dbType = sec.Key("TYPE").String()
dbName = sec.Key("NAME").String()
user = sec.Key("USER").String()
password = sec.Key("PASSWORD").String()
host = sec.Key("HOST").String()
port = sec.Key("PORT").String()
tablePrefix = sec.Key("TABLE_PREFIX").String()
dbType = sec.Key("Type").String()
dbName = sec.Key("Name").String()
user = sec.Key("User").String()
password = sec.Key("Password").String()
host = sec.Key("Host").String()
port = sec.Key("Port").String()
tablePrefix = sec.Key("TablePrefix").String()
db, err = gorm.Open(dbType, fmt.Sprintf("host=%s user=%s dbname=%s port=%s sslmode=disable password=%s",
host,