This commit is contained in:
2026-07-03 10:38:22 +08:00
parent 03470475aa
commit f830406be7
+5
View File
@@ -2,6 +2,7 @@ package router
import ( import (
"net/http" "net/http"
"os"
"strings" "strings"
"lmvpn/internal/handler" "lmvpn/internal/handler"
@@ -43,6 +44,10 @@ func Setup(r *gin.Engine) {
return return
} }
path := "./dist" + c.Request.URL.Path
if _, err := os.Stat(path); os.IsNotExist(err) {
c.Request.URL.Path = "/"
}
fs.ServeHTTP(c.Writer, c.Request) fs.ServeHTTP(c.Writer, c.Request)
c.Abort() c.Abort()
}) })