From 0cbe4c8c26262918d6fc9afb9b8a5346e4f153ad Mon Sep 17 00:00:00 2001 From: xc Date: Thu, 18 Sep 2025 15:26:44 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4remote=E7=9A=84=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scagent/core/FileRpc.go | 12 +++++++----- vue/afvue/src/views/Sfilecompare.vue | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/scagent/core/FileRpc.go b/scagent/core/FileRpc.go index a01c664..93d9d17 100644 --- a/scagent/core/FileRpc.go +++ b/scagent/core/FileRpc.go @@ -36,7 +36,7 @@ type ZipBlock struct { Basepath string Curpath string // 当前路径 SelFile []string // 选中的文件 - RemoteIp string // 远程主机地址,带端口 + RemoteAdr string // 远程主机地址,带端口 RemotePath string // 远程主机的存储路径 } @@ -135,14 +135,16 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error { rest := <-taskId // 如果压缩包生成成功以后再执行 if strings.EqualFold(strings.ToLower(rest), "arcok") { - // 返回压缩包名称 - *reply = ziprl + // 合并为实际路径 + remotePath := path.Join("/www/wwwroot", args.RemotePath, zpFileName) // 发送文件到远程服务器上 - err := clientUploadFile(args.RemoteIp, ziprl, args.RemotePath) + err := clientUploadFile(args.RemoteAdr, ziprl, remotePath) if err != nil { logger.Error("Compress", zap.String("msg", "上传文件到远程服务器失败"), zap.Error(err)) - return err + return nil } + // 返回压缩包名称 + *reply = ziprl } return nil diff --git a/vue/afvue/src/views/Sfilecompare.vue b/vue/afvue/src/views/Sfilecompare.vue index d7303f7..ee98586 100644 --- a/vue/afvue/src/views/Sfilecompare.vue +++ b/vue/afvue/src/views/Sfilecompare.vue @@ -17,7 +17,7 @@
-
+
  • @@ -86,7 +86,7 @@
    - +
    @@ -329,7 +329,9 @@ export default { let data = { sfiles: this.selectedFiles, serverip: this.$refs.fsip.value, - curpath: curpath + curpath: curpath, + remoteaddr: this.$refs.ssip.value, + remotepath: this.sspath, } // build to schema const pdata = new URLSearchParams(data)