Browse Source

修正获取文件错误的bug

master
453530270@qq.com 1 year ago
parent
commit
feaaa854df
  1. 2
      fss/core/sendzip.go
  2. BIN
      fss/fss
  3. 44
      fss/fsw/index.html

2
fss/core/sendzip.go

@ -29,7 +29,7 @@ func SendZip(w http.ResponseWriter, r *http.Request) {
// 选中的路径,可以为空
wtculpath := r.Form["curpath"]
if wtculpath != nil {
tpath = wtculpath[0]
tpath = util.Base64dec(wtculpath[0])
}
// 实际路径
realFilePath := filepath.Join(config.G.FilePath, tpath)

BIN
fss/fss

Binary file not shown.

44
fss/fsw/index.html

@ -283,7 +283,7 @@
//
html += "<li class=\"list-group-item optzone " + chgflag + "\"><div class=\"col-md-10\">";
html += "<input type=\"checkbox\" class="+st+'mfile'+" name=\"sfiles[]\" value=" + v.fname + " />";
html += "<input type=\"checkbox\" class="+st+'mfile'+" name=\"sfiles\" value=" + v.fname + " />";
if (v.dirflag) { //如果是文件夹
html += "<span class=\"icon folder-icon\"></span>" ;
html += v.fname
@ -309,7 +309,12 @@
})
// append to html
html += "<input type='hidden' name='curpath' value='"+upath+"'>";
html += "<input type='hidden' name='serverip' value='"+scip+"'>";
if(st=="tg"){
html += "<input type='hidden' name='serverip' value='"+scip+"'>";
}else{
html += "<input type='hidden' name='serverip' value='192.168.66.16'>";
}
// $("#tgsc").html(html)
$(elemnt).html(html);
writelog(scip + "获取数据:" + res.data.list.length + "条数据")
@ -325,23 +330,6 @@
$("#rstatus").append(hprex);
}
//同步文件
$(".gsbtn").on("click", function () {
var ff = $(this).attr("fid");
var fpa = $(this).attr("fpa");
// build post body
var param = { sip: scip, bfile: ff, bpath: fpa }
// do post
$.post("./sup", param, function (res) {
if (res.status == '200') {
alert("操作成功");
}
});
return false;
})
//全选按钮设置点击事件
$("#slall").click(function () {
let st = $(this).data("st");
@ -360,7 +348,7 @@
//同步操作
$("#sybtn").on("click", function () {
// var st = $(this).data("st")
$(".ssform").submit();
// $(".ssform").submit();
// var ss = $("."+st+"mfile").hasClass("checked").val()
// console.log(ss)
// 获取选中的文件 或者文件夹
@ -370,14 +358,14 @@
// var ss = $("input[name='sfiles[]']:checked").val();
//var ss = $(".mfile").has("checked").val()
// console.log(ss)
// var ttsip = $("input[name='serverip']").val();
// if (ttsip == "") {
// alert("老天鹅,你还没填写目标服务器地址。");
// } else {
// $("#hscip").val(scip);
// // 提交表单
// $(".form-inline").submit();
// }
var ttsip = $("input[name='tsip']").val();
if (ttsip == "") {
alert("老天鹅,你还没填写目标服务器地址。");
} else {
// 提交表单
$(".ssform").submit();
}
});

Loading…
Cancel
Save