整理
This commit is contained in:
7
main.go
7
main.go
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user