From 30ec2d5825e2672f9991f1c39725cdb65c6baa4f Mon Sep 17 00:00:00 2001 From: xc Date: Tue, 16 Sep 2025 19:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9F=BA=E7=A1=80=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aufs/core/sendzip.go | 10 ++++++---- scagent/core/FileRpc.go | 8 ++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/aufs/core/sendzip.go b/aufs/core/sendzip.go index 8f6a18b..145b184 100644 --- a/aufs/core/sendzip.go +++ b/aufs/core/sendzip.go @@ -16,8 +16,9 @@ import ( // 压缩文件 type ZipBlock struct { - Curpath string // 当前路径 - SelFile []string // 选中的文件 + Basepath string // 基础路径 + Curpath string // 当前路径 + SelFile []string // 选中的文件 } // 返回的结果结构 @@ -44,8 +45,9 @@ func SendZip(w http.ResponseWriter, r *http.Request) { } // 构建 zipblock := ZipBlock{ - Curpath: wtculpath[0], - SelFile: zipfarr, + Basepath: "/www/wwwroot", + Curpath: wtculpath[0], + SelFile: zipfarr, } // 从serip 切割出ip 和端口 splitip := strings.Split(serip[0], ":") diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index 3f1fd41..2679a01 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -5,7 +5,6 @@ import ( "os" "path" "path/filepath" - "scagent/config" "scagent/util" "strings" "time" @@ -26,8 +25,9 @@ type FileChunk struct { // 压缩文件 type ZipBlock struct { - Curpath string // 当前路径 - SelFile []string // 选中的文件 + Basepath string + Curpath string // 当前路径 + SelFile []string // 选中的文件 } // Upload 接收文件分片并写入到本地文件 @@ -60,7 +60,7 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { logger := util.NewProductionLogger() defer logger.Sync() // 实际路径 - realFilePath := filepath.Join(config.G.FilePath, args.Curpath) + realFilePath := filepath.Join(args.Basepath, args.Curpath) // zip 文件名 zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip" // 创建zip 异步?