Modify: check static file version when statics folder exists
This commit is contained in:
parent
99033d61c6
commit
9910f8d732
1 changed files with 35 additions and 34 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue