From f58c6e8b6dd1a6876f2f946f5c7f170c0d7c46a4 Mon Sep 17 00:00:00 2001 From: xc Date: Thu, 18 Sep 2025 15:08:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8E=B7=E5=8F=96=E7=9B=AE=E6=A0=87=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aufs/core/sendzip.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/aufs/core/sendzip.go b/aufs/core/sendzip.go index 74b390f..19a53ac 100644 --- a/aufs/core/sendzip.go +++ b/aufs/core/sendzip.go @@ -19,7 +19,7 @@ type ZipBlock struct { Basepath string // 基础路径 Curpath string // 当前路径 SelFile []string // 选中的文件 - RemoteIp string // 远程主机地址,带端口 + RemoteAddr string // 远程主机地址,带端口 RemotePath string // 远程主机的存储路径 } @@ -49,14 +49,26 @@ func SendZip(w http.ResponseWriter, r *http.Request) { return } // 获取远程服务器信息 + remoteaddr := r.Form["remoteaddr"] + if remoteaddr[0] == "" { + http.Error(w, "remote server addr is blank!", http.StatusInternalServerError) + return + } + + // 远程的路径信息 + remotepath := r.Form["remotepath"] + if remotepath[0] == "" { + http.Error(w, "remote server path is blank!", http.StatusInternalServerError) + return + } // 构建 zipblock := ZipBlock{ Basepath: "/www/wwwroot", Curpath: wtculpath[0], SelFile: zipfarr, - RemoteIp: serip[0], - RemotePath: "/www/wwwroot/sync_zips", + RemoteAddr: remoteaddr[0], + RemotePath: remotepath[0], } // 从serip 切割出ip 和端口 splitip := strings.Split(serip[0], ":")