Browse Source

修复使用disble 导致不提交的bug

master
453530270@qq.com 2 years ago
parent
commit
4cb2b85715
  1. 20
      fssc/internal/handler/handler.go
  2. 2
      fssc/web/list.tmpl

20
fssc/internal/handler/handler.go

@ -164,11 +164,14 @@ func SendZip(w http.ResponseWriter, r *http.Request) {
return return
} }
tpath := ""
// 选中的路径,可以为空 // 选中的路径,可以为空
//wtculpath := r.Form["curpath"] wtculpath := r.Form["curpath"]
if wtculpath != nil {
tpath = wtculpath[0]
}
// 实际路径 // 实际路径
realFilePath := filepath.Join(config.G.FilePath, "") realFilePath := filepath.Join(config.G.FilePath, tpath)
// zip 文件名 // zip 文件名
zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip" zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip"
@ -240,18 +243,19 @@ func SendHandler(w http.ResponseWriter, r *http.Request) {
} }
data := struct { data := struct {
DeviceName string DeviceName string
//Rundir string Rundir string
IsDir bool IsDir bool
FileName string FileName string
DownloadPath string DownloadPath string
UrlPath string UrlPath string
Files []os.DirEntry Files []os.DirEntry
}{ }{
DeviceName: config.G.DeviceName, DeviceName: config.G.DeviceName,
//Rundir: config.G.FilePath, Rundir: config.G.FilePath,
DownloadPath: downloadPath, DownloadPath: downloadPath,
UrlPath: strings.TrimSuffix(r.URL.Path, "/"), //UrlPath: strings.TrimSuffix(r.URL.Path, "/"),
UrlPath: r.URL.Path,
} }
if fileInfo.IsDir() { if fileInfo.IsDir() {

2
fssc/web/list.tmpl

@ -127,7 +127,7 @@
<div class="col-md-5"> <div class="col-md-5">
<div class="form-group"> <div class="form-group">
<label>相对路径</label> <label>相对路径</label>
<input type="text" class="form-control" disabled="disabled" name="curpath" value="{{ .UrlPath }}"/> <input type="text" class="form-control" name="curpath" value="{{ .UrlPath }}"/>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save