完善后台的图标库引用逻辑和在线图标库的引用

This commit is contained in:
2026-08-05 05:47:26 +08:00
parent ac740c24fd
commit e3aed70d6c
31 changed files with 3934 additions and 1678 deletions
+2 -2
View File
@@ -16,8 +16,8 @@ import (
"home-vue-go/internal/ent"
"home-vue-go/internal/ent/migrate"
_ "github.com/mattn/go-sqlite3"
"golang.org/x/crypto/bcrypt"
_ "modernc.org/sqlite"
)
const siteConfigPayloadColumn = "config_json"
@@ -28,7 +28,7 @@ type Database struct {
}
func Init(dbPath string, cfg *config.Config) (*Database, error) {
db, err := sql.Open("sqlite3", dbPath+"?_fk=1")
db, err := sql.Open("sqlite", dbPath+"?_pragma=foreign_keys(1)")
if err != nil {
return nil, err
}
-4
View File
@@ -4,7 +4,6 @@ import (
"context"
"os"
"path/filepath"
"strings"
"testing"
"home-vue-go/internal/config"
@@ -25,9 +24,6 @@ func TestSiteSettingsMigrationAndBooleanPersistence(t *testing.T) {
cfg := config.New(dataDir)
db, err := Init(cfg.DatabasePath, cfg)
if err != nil {
if strings.Contains(err.Error(), "CGO_ENABLED=0") {
t.Skip("go-sqlite3 requires cgo for the database integration test")
}
t.Fatal(err)
}
defer db.Close()