Browse Source

调整zip存储路径

master
453530270@qq.com 1 year ago
parent
commit
e6ac161ade
  1. 5
      fss/build.bat
  2. BIN
      fss/fss
  3. 8
      fss/fsw/index.html
  4. 4
      fss/util/fsutil.go

5
fss/build.bat

@ -0,0 +1,5 @@
color 87
set GOOS=linux
set GOARCH=amd64
set CGO_ENABLED=0
go build -o fss main.go

BIN
fss/fss

Binary file not shown.

8
fss/fsw/index.html

@ -257,8 +257,12 @@
// 获取目标服务器的信息
var gescinfo = function (elemnt, scip, upath,st) {
upath = upath.replace("/\\/g", "\/");
// 客户端的状态地址
var url = "http://" + scip + ":9099/sc?p=" + upath;
var url=""; // 客户端的状态地址
if(scip=='' || scip=='127.0.0.1' || scip=="localhost"){
url="./sc?p="+upath;
}else{
url = "http://" + scip + ":9099/sc?p=" + upath;
}
//
var html = "";
$.getJSON(url, function (res) {

4
fss/util/fsutil.go

@ -313,13 +313,13 @@ func CompressToZip(dest string, currentPath string, paths []string) error {
// 打开files 目录
filesPath := ""
if dir, err := os.Getwd(); err == nil {
filesPath = dir + "/files/"
filesPath = dir + "/sync_zips/"
}
if err := os.MkdirAll(filesPath, 0755); err != nil {
fmt.Println(err.Error())
}
// ToSlash 过滤windows的斜杠引起的bug
zfile, err := os.Create(path.Join("./files", "/", dest))
zfile, err := os.Create(path.Join("./sync_zips", "/", dest))
if err != nil {
return err
}

Loading…
Cancel
Save