|
@@ -10,7 +10,7 @@ import (
|
|
"strings"
|
|
"strings"
|
|
)
|
|
)
|
|
|
|
|
|
-//go:embed front
|
|
|
|
|
|
+//go:embed front/
|
|
var front embed.FS
|
|
var front embed.FS
|
|
|
|
|
|
type Option struct {
|
|
type Option struct {
|
|
@@ -50,8 +50,7 @@ func Handler(option *Option) gin.HandlerFunc {
|
|
case docJsonPath:
|
|
case docJsonPath:
|
|
writeDocJson(c, docJson)
|
|
writeDocJson(c, docJson)
|
|
default:
|
|
default:
|
|
- //filePath := strings.ReplaceAll(c.Request.RequestURI, option.RelativePath, "")
|
|
|
|
- filePath := strings.TrimPrefix(c.Request.RequestURI, option.RelativePath)
|
|
|
|
|
|
+ filePath := "front" + strings.TrimPrefix(c.Request.RequestURI, option.RelativePath)
|
|
c.FileFromFS(filePath, http.FS(front))
|
|
c.FileFromFS(filePath, http.FS(front))
|
|
}
|
|
}
|
|
}
|
|
}
|