Modify: use INT represent Database port
This commit is contained in:
parent
554493dea4
commit
2e43f8ed5b
3 changed files with 3 additions and 2 deletions
|
@ -32,7 +32,7 @@ func Init() {
|
||||||
// 未指定数据库时,使用SQLite
|
// 未指定数据库时,使用SQLite
|
||||||
db, err = gorm.Open("sqlite3", util.RelativePath(conf.DatabaseConfig.DBFile))
|
db, err = gorm.Open("sqlite3", util.RelativePath(conf.DatabaseConfig.DBFile))
|
||||||
} else {
|
} else {
|
||||||
db, err = gorm.Open(conf.DatabaseConfig.Type, fmt.Sprintf("%s:%s@(%s:%s)/%s?charset=utf8&parseTime=True&loc=Local",
|
db, err = gorm.Open(conf.DatabaseConfig.Type, fmt.Sprintf("%s:%s@(%s:%d)/%s?charset=utf8&parseTime=True&loc=Local",
|
||||||
conf.DatabaseConfig.User,
|
conf.DatabaseConfig.User,
|
||||||
conf.DatabaseConfig.Password,
|
conf.DatabaseConfig.Password,
|
||||||
conf.DatabaseConfig.Host,
|
conf.DatabaseConfig.Host,
|
||||||
|
|
|
@ -15,7 +15,7 @@ type database struct {
|
||||||
Name string
|
Name string
|
||||||
TablePrefix string
|
TablePrefix string
|
||||||
DBFile string
|
DBFile string
|
||||||
Port string
|
Port int
|
||||||
}
|
}
|
||||||
|
|
||||||
// system 系统通用配置
|
// system 系统通用配置
|
||||||
|
|
|
@ -13,6 +13,7 @@ var RedisConfig = &redis{
|
||||||
var DatabaseConfig = &database{
|
var DatabaseConfig = &database{
|
||||||
Type: "UNSET",
|
Type: "UNSET",
|
||||||
DBFile: "cloudreve.db",
|
DBFile: "cloudreve.db",
|
||||||
|
Port: 3306,
|
||||||
}
|
}
|
||||||
|
|
||||||
// SystemConfig 系统公用配置
|
// SystemConfig 系统公用配置
|
||||||
|
|
Loading…
Add table
Reference in a new issue