From b43e513bbf029d61f7614b8d1c43034e928a4cb8 Mon Sep 17 00:00:00 2001 From: go-aurora-engine Date: Tue, 28 Mar 2023 16:53:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=B5=8C=E5=85=A5?= =?UTF-8?q?=E5=BC=8F=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=E6=89=BE=E4=B8=8D?= =?UTF-8?q?=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/resource.go b/route/resource.go index 663e597..4943845 100644 --- a/route/resource.go +++ b/route/resource.go @@ -55,7 +55,7 @@ func init() { func (router *Router) resourceFun(w http.ResponseWriter, mapping string, path string, rt string) { var data []byte if router.staticSF != (embed.FS{}) { - relative := filepath.Join(router.Resource, path) + relative := filepath.Join(router.Resource, mapping) relative = filepath.ToSlash(relative) data, _ = router.staticSF.ReadFile(relative) } else { -- Gitee From c9f134d3acbca52d4e465358cfdb37641d25d16a Mon Sep 17 00:00:00 2001 From: go-aurora-engine Date: Tue, 28 Mar 2023 16:55:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=E9=9D=99=E6=80=81=E8=B5=84=E6=BA=90=E6=89=BE?= =?UTF-8?q?=E4=B8=8D=E5=88=B0=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/route/resource.go b/route/resource.go index 4943845..7fd0892 100644 --- a/route/resource.go +++ b/route/resource.go @@ -59,7 +59,7 @@ func (router *Router) resourceFun(w http.ResponseWriter, mapping string, path st relative = filepath.ToSlash(relative) data, _ = router.staticSF.ReadFile(relative) } else { - fullpath := filepath.Join(router.Root, router.Resource, path) + fullpath := filepath.Join(router.Root, router.Resource, mapping) data = router.readResource(fullpath) } if data != nil { -- Gitee