shaoyongjun ea60ef4b4d to:sync
2024-04-29 23:09:19 +08:00

30 lines
823 B
Go

package apps
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.File("static/login.html")
})
g.GET("css/login.css", func(c echo.Context) error {
c.Response().Header().Set("Cache-Control", "max-age=3600")
return c.File("static/css/login.css")
})
g.GET("img/003.jpeg", func(c echo.Context) error {
c.Response().Header().Set("Cache-Control", "max-age=3600")
return c.File("static/img/003.jpeg")
})
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>`)
})
}