File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -100,7 +100,7 @@ func Tmpl(c *fiber.Ctx) error {
100100
101101 // 定义startsWith函数
102102 funcMap := template.FuncMap {
103- "startsWith " : func (s , prefix string ) bool {
103+ "starts_with " : func (s , prefix string ) bool {
104104 return strings .HasPrefix (s , prefix )
105105 },
106106 "add_path" : func (p string ) string {
@@ -115,7 +115,7 @@ func Tmpl(c *fiber.Ctx) error {
115115 if original_url == "/" {
116116 original_url = ""
117117 }
118- return c .BaseURL () + "/download" + c . OriginalURL () + "/" + p
118+ return c .BaseURL () + "/download" + original_url + "/" + p
119119 },
120120 }
121121
Original file line number Diff line number Diff line change 22< body >
33 < div > < a href ="{{.parent_patch}} "> /..</ a > </ div >
44 {{range $value :=.file_list}}
5- {{if startsWith $value "/"}}
5+ {{if starts_with $value "/"}}
66 < div > < a href ="{{add_path $value}} "> {{$value}}</ a > </ div >
77 {{else}}
88 < div > < a href ="{{download_path $value}} "> {{$value}}</ a > </ div >
You can’t perform that action at this time.
0 commit comments