Fix: failed tests while static files not loaded

This commit is contained in:
HFO4
2020-05-19 10:34:16 +08:00
parent ed684420a2
commit 4c458df666
2 changed files with 15 additions and 0 deletions

View File

@@ -47,6 +47,10 @@ func InjectSiteInfo() gin.HandlerFunc {
ignoreFunc := func(c *gin.Context) {
c.Next()
}
if bootstrap.StaticFS == nil {
return ignoreFunc
}
// 读取index.html
file, err := bootstrap.StaticFS.Open("/index.html")
if err != nil {