This commit is contained in:
张超
2025-07-12 15:56:36 +08:00
parent 117902d4d8
commit 5fd7411f9a
11 changed files with 66 additions and 97 deletions

View File

@@ -4,12 +4,11 @@ import (
"go_blog/config"
"go_blog/models"
"go_blog/routers"
"go_blog/utils"
"log/slog"
"os"
"time"
"go_blog/themes"
"gorm.io/gorm"
"github.com/gin-contrib/sessions"
@@ -42,7 +41,7 @@ func main() {
}
}()
// 4. 初始化主题系统
themeManager := themes.NewManager("web\\themes")
themeManager := utils.NewManager("web\\themes")
if err := themeManager.LoadTheme(conf.Theme.Current); err != nil {
slog.Error("主题系统初始化失败", "error", err)
os.Exit(1)
@@ -98,7 +97,7 @@ func configMiddleware(cfg *config.Config) gin.HandlerFunc {
}
// 主题管理器中间件
func themeMiddleware(manager *themes.ThemeManager) gin.HandlerFunc {
func themeMiddleware(manager *utils.ThemeManager) gin.HandlerFunc {
return func(c *gin.Context) {
c.Set("ThemeManager", manager)
c.Next()