Fix: relative path for SQLite file

This commit is contained in:
HFO4
2020-03-11 15:46:24 +08:00
parent 45b54b3455
commit 8ad7702736
3 changed files with 2 additions and 4 deletions

View File

@@ -30,7 +30,7 @@ func Init() {
} else {
if conf.DatabaseConfig.Type == "UNSET" {
// 未指定数据库时使用SQLite
db, err = gorm.Open("sqlite3", "cloudreve.db")
db, err = gorm.Open("sqlite3", util.RelativePath("cloudreve.db"))
} else {
db, err = gorm.Open(conf.DatabaseConfig.Type, fmt.Sprintf("%s:%s@(%s)/%s?charset=utf8&parseTime=True&loc=Local",
conf.DatabaseConfig.User,