add return parameter name for function Cas of gtype;improve Response.Redirect* functions by adding optional parameter code

This commit is contained in:
John
2020-01-16 21:04:28 +08:00
parent 872d674182
commit b867b2a0bc
15 changed files with 46 additions and 40 deletions

View File

@ -72,11 +72,11 @@ func doZipPathWriter(path string, zipWriter *zip.Writer, prefix ...string) error
headerPrefix = prefix[0]
}
headerPrefix = strings.TrimRight(headerPrefix, "\\/")
if gfile.IsDir(path) {
if len(headerPrefix) > 0 {
headerPrefix += "/"
}
headerPrefix = headerPrefix + gfile.Basename(path)
if len(headerPrefix) > 0 && gfile.IsDir(path) {
headerPrefix += "/"
}
if headerPrefix == "" {
headerPrefix = gfile.Basename(path)
}
headerPrefix = strings.Replace(headerPrefix, "//", "/", -1)
for _, file := range files {