1
0
mirror of https://github.com/fumiama/paper-manager.git synced 2026-06-25 05:20:16 +08:00

add backend/file structs

This commit is contained in:
源文雨
2023-03-22 18:29:46 +08:00
parent ac248b540a
commit 5aeca6d5fa
4 changed files with 175 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ package global
import (
"errors"
"os"
"strconv"
"time"
@@ -114,6 +115,18 @@ func init() {
}, "系统")
logrus.Warn("[user] 初次启动, 创建初始账户 fumiama 密码 123456")
}
err = UserDB.db.Close()
if err != nil {
panic(err)
}
err = os.Chmod(UserDB.db.DBPath, 0600)
if err != nil {
panic(err)
}
err = UserDB.db.Open(time.Hour)
if err != nil {
panic(err)
}
}
// User stores a user in table named UserTableUser