fix: issues

This commit is contained in:
Rogee
2024-12-13 20:12:57 +08:00
parent 8a48f202f2
commit 13ebc91220
11 changed files with 109 additions and 37 deletions

View File

@@ -1,6 +1,8 @@
package http
import (
"path/filepath"
"backend/modules/medias"
"backend/modules/middlewares"
"backend/modules/users"
@@ -15,7 +17,6 @@ import (
"git.ipao.vip/rogeecn/atom"
"git.ipao.vip/rogeecn/atom/container"
"git.ipao.vip/rogeecn/atom/contracts"
"github.com/gofiber/fiber/v3"
"github.com/gofiber/fiber/v3/middleware/favicon"
"github.com/gofiber/fiber/v3/middleware/static"
log "github.com/sirupsen/logrus"
@@ -70,21 +71,19 @@ func Serve(cmd *cobra.Command, args []string) error {
engine.Use(mid.DebugMode)
engine.Use(mid.ProcessResponse)
engine.Use(mid.WeChatVerify)
wechatGroup := engine.Group("/t")
wechatGroup.Use(mid.WeChatVerify)
wechatGroup.Use(mid.WeChatAuthUserInfo)
wechatGroup.Use(mid.WeChatSilentAuth)
wechatGroup.Get("*", func(c fiber.Ctx) error {
return c.SendString("ok")
})
engine.Use("/t+", mid.WeChatAuthUserInfo, mid.WeChatSilentAuth)
http.Service.Engine.Use(favicon.New(favicon.Config{
Data: []byte{},
}))
http.Service.Engine.Use("/static", static.New(http.Storage.Path, static.Config{
Browse: true,
Browse: http.App.IsDevMode(),
}))
http.Service.Engine.Use("/assets", static.New(filepath.Join(http.Storage.Asset, "assets"), static.Config{
Browse: http.App.IsDevMode(),
}))
group := http.Service.Engine.Group("/v1")