This commit is contained in:
shaoyongjun 2024-04-30 00:01:49 +08:00
parent cd1fc2a48b
commit 1d81f1b16f
2 changed files with 4 additions and 3 deletions

View File

@ -34,7 +34,7 @@ func initImgMap() map[string][]byte {
var dataMap = make(map[string][]byte, 8)
//login.html
data, err := imgList.ReadFile("003.jpeg")
data, err := imgList.ReadFile("img/003.jpeg")
if err == nil {
dataMap["003.jpeg"] = data
}
@ -45,7 +45,7 @@ func initImgMap() map[string][]byte {
func initCssMap() map[string][]byte {
var dataMap = make(map[string][]byte, 8)
//login.html
data, err := cssList.ReadFile("login.css")
data, err := cssList.ReadFile("css/login.css")
if err == nil {
dataMap["login.css"] = data
}

View File

@ -16,7 +16,8 @@ func InitStaticGroup(g *echo.Group) {
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"])
data, _ := cssMap["login.css"]
return c.Blob(http.StatusOK, "text/html; charset=utf-8", data)
})
g.GET("img/003.jpeg", func(c echo.Context) error {