mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Modify: check static file version when statics folder exists
This commit is contained in:
@@ -45,13 +45,6 @@ func InitStatic() {
|
|||||||
if util.Exists(util.RelativePath("statics")) {
|
if util.Exists(util.RelativePath("statics")) {
|
||||||
util.Log().Info("检测到 statics 目录存在,将使用此目录下的静态资源文件")
|
util.Log().Info("检测到 statics 目录存在,将使用此目录下的静态资源文件")
|
||||||
StaticFS = static.LocalFile(util.RelativePath("statics"), false)
|
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")
|
f, err := StaticFS.Open("version.json")
|
||||||
@@ -87,4 +80,12 @@ func InitStatic() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
StaticFS = &GinFS{}
|
||||||
|
StaticFS.(*GinFS).FS, err = fs.New()
|
||||||
|
if err != nil {
|
||||||
|
util.Log().Panic("无法初始化静态资源, %s", err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user