fix: issues
This commit is contained in:
@@ -18,6 +18,7 @@ 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"
|
||||
@@ -77,14 +78,22 @@ func Serve(cmd *cobra.Command, args []string) error {
|
||||
engine.Use(mid.WeChatVerify)
|
||||
|
||||
engine.Use([]string{"/t/:tenant", "/t/:tenant/*"}, mid.WeChatAuth, http.Wechat.Render)
|
||||
engine.Get("/posters/:tenant/:hash.jpg", func(c fiber.Ctx) error {
|
||||
tenant := c.Params("tenant")
|
||||
hash := c.Params("hash")
|
||||
|
||||
return c.SendFile(filepath.Join(
|
||||
http.Storage.Path,
|
||||
tenant,
|
||||
"posters",
|
||||
hash+".jpg",
|
||||
))
|
||||
})
|
||||
|
||||
http.Service.Engine.Use(favicon.New(favicon.Config{
|
||||
Data: []byte{},
|
||||
}))
|
||||
|
||||
http.Service.Engine.Use("/static", static.New(http.Storage.Path, static.Config{
|
||||
Browse: http.App.IsDevMode(),
|
||||
}))
|
||||
http.Service.Engine.Use("/assets", static.New(filepath.Join(http.Storage.Asset, "assets"), static.Config{
|
||||
Browse: http.App.IsDevMode(),
|
||||
}))
|
||||
|
||||
Reference in New Issue
Block a user