From 2297d14bb1ae6e382c0b7b595e6e93036f616bff Mon Sep 17 00:00:00 2001 From: Jrohy Date: Sat, 3 Apr 2021 20:27:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=80=E5=8C=96=E9=9D=99=E6=80=81=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E8=B0=83=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/web.go | 4 ---- 1 file changed, 4 deletions(-) diff --git a/web/web.go b/web/web.go index b595be1a..7e607648 100644 --- a/web/web.go +++ b/web/web.go @@ -137,16 +137,12 @@ func commonRouter(router *gin.Engine) { } func staticRouter(router *gin.Engine) { - // 设置静态资源 staticFs, _ := fs.Sub(f, "templates/static") router.StaticFS("/static", http.FS(staticFs)) router.GET("/", func(c *gin.Context) { - c.Writer.WriteHeader(http.StatusOK) indexHTML, _ := f.ReadFile("templates/" + "index.html") c.Writer.Write(indexHTML) - c.Writer.Header().Add("Accept", "text/html") - c.Writer.Flush() }) }