提交 2e43f8ed 编写于 作者: H HFO4

Modify: use INT represent Database port

上级 554493de
......@@ -32,7 +32,7 @@ func Init() {
// 未指定数据库时,使用SQLite
db, err = gorm.Open("sqlite3", util.RelativePath(conf.DatabaseConfig.DBFile))
} 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.Password,
conf.DatabaseConfig.Host,
......
......@@ -15,7 +15,7 @@ type database struct {
Name string
TablePrefix string
DBFile string
Port string
Port int
}
// system 系统通用配置
......
......@@ -13,6 +13,7 @@ var RedisConfig = &redis{
var DatabaseConfig = &database{
Type: "UNSET",
DBFile: "cloudreve.db",
Port: 3306,
}
// SystemConfig 系统公用配置
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册