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 @@
-
+