Fix: init fs router err

pull/31/head
zijiren233 1 year ago
parent 2fb4767ffb
commit eb8beec18b

@ -39,7 +39,10 @@ func initFSRouter(e *gin.RouterGroup, f fs.ReadDirFS, path string) error {
} }
for _, dir := range dirs { for _, dir := range dirs {
if dir.IsDir() { if dir.IsDir() {
return initFSRouter(e, f, filepath.Join(path, dir.Name())) err = initFSRouter(e, f, filepath.Join(path, dir.Name()))
if err != nil {
return err
}
} else { } else {
e.StaticFileFS(filepath.Join(path, dir.Name()), filepath.Join(path, dir.Name()), http.FS(f)) e.StaticFileFS(filepath.Join(path, dir.Name()), filepath.Join(path, dir.Name()), http.FS(f))
} }

Loading…
Cancel
Save