|
|
|
@ -45,13 +45,6 @@ func InitStatic() {
|
|
|
|
|
if util.Exists(util.RelativePath("statics")) {
|
|
|
|
|
util.Log().Info("检测到 statics 目录存在,将使用此目录下的静态资源文件")
|
|
|
|
|
StaticFS = static.LocalFile(util.RelativePath("statics"), false)
|
|
|
|
|
} else {
|
|
|
|
|
StaticFS = &GinFS{}
|
|
|
|
|
StaticFS.(*GinFS).FS, err = fs.New()
|
|
|
|
|
if err != nil {
|
|
|
|
|
util.Log().Panic("无法初始化静态资源, %s", err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 检查静态资源的版本
|
|
|
|
|
f, err := StaticFS.Open("version.json")
|
|
|
|
@ -87,4 +80,12 @@ func InitStatic() {
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
StaticFS = &GinFS{}
|
|
|
|
|
StaticFS.(*GinFS).FS, err = fs.New()
|
|
|
|
|
if err != nil {
|
|
|
|
|
util.Log().Panic("无法初始化静态资源, %s", err)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|