shaoyongjun cd1fc2a48b to:sync
2024-04-29 23:59:09 +08:00

32 lines
953 B
Go

package static
import (
"github.com/labstack/echo/v4"
"net/http"
)
func InitStaticGroup(g *echo.Group) {
g.GET("login.html", func(c echo.Context) error {
c.Response().Header().Set("Content-Type", "text/html; charset=utf-8")
c.Response().Header().Set("Cache-Control", "max-age=3600")
return c.Blob(http.StatusOK, "text/html; charset=utf-8", pageMap["login.html"])
})
g.GET("css/login.css", func(c echo.Context) error {
c.Response().Header().Set("Cache-Control", "max-age=3600")
return c.Blob(http.StatusOK, "text/html; charset=utf-8", cssMap["login.css"])
})
g.GET("img/003.jpeg", func(c echo.Context) error {
c.Response().Header().Set("Cache-Control", "max-age=3600")
return c.Blob(http.StatusOK, "text/html; charset=utf-8", cssMap["login.css"])
})
g.GET("/aa", func(c echo.Context) error {
c.Response().Header().Set("Content-Type", "text/html; charset=utf-8")
return c.String(http.StatusOK, `<p>html代码</p>`)
})
}