修复模版取文件index.html错误

This commit is contained in:
srcrs 2023-09-02 23:59:25 +08:00
parent d115310bb9
commit a42e18b5f5

View File

@ -82,7 +82,7 @@ func tplHandler(w http.ResponseWriter, r *http.Request) {
},
}
// 加载模板文件
tmpl, err := tmplInstance.Funcs(funcMap).ParseFiles("index.html")
tmpl, err := tmplInstance.Funcs(funcMap).ParseFS(fileIndex, "index.html")
if err != nil {
log.Println("模板加载错误:", err)
return