From e78d9e5d2b4b1b1a1b04c3abdf480b3ec9456bd4 Mon Sep 17 00:00:00 2001 From: Yang Luo Date: Fri, 21 Apr 2023 10:12:09 +0800 Subject: [PATCH] Fix local file system storage provider path error --- routers/static_filter.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routers/static_filter.go b/routers/static_filter.go index 7063ad21..4761d804 100644 --- a/routers/static_filter.go +++ b/routers/static_filter.go @@ -51,6 +51,12 @@ func StaticFilter(ctx *context.Context) { path += urlPath } + path2 := strings.TrimLeft(path, "web/build/images/") + if util.FileExist(path2) { + http.ServeFile(ctx.ResponseWriter, ctx.Request, path2) + return + } + if !util.FileExist(path) { path = "web/build/index.html" }