Browse Source

增加基础路径

master
xyiege 4 months ago
parent
commit
30ec2d5825
  1. 2
      aufs/core/sendzip.go
  2. 4
      scagent/core/FileRpc.go

2
aufs/core/sendzip.go

@ -16,6 +16,7 @@ import (
// 压缩文件 // 压缩文件
type ZipBlock struct { type ZipBlock struct {
Basepath string // 基础路径
Curpath string // 当前路径 Curpath string // 当前路径
SelFile []string // 选中的文件 SelFile []string // 选中的文件
} }
@ -44,6 +45,7 @@ func SendZip(w http.ResponseWriter, r *http.Request) {
} }
// 构建 // 构建
zipblock := ZipBlock{ zipblock := ZipBlock{
Basepath: "/www/wwwroot",
Curpath: wtculpath[0], Curpath: wtculpath[0],
SelFile: zipfarr, SelFile: zipfarr,
} }

4
scagent/core/FileRpc.go

@ -5,7 +5,6 @@ import (
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
"scagent/config"
"scagent/util" "scagent/util"
"strings" "strings"
"time" "time"
@ -26,6 +25,7 @@ type FileChunk struct {
// 压缩文件 // 压缩文件
type ZipBlock struct { type ZipBlock struct {
Basepath string
Curpath string // 当前路径 Curpath string // 当前路径
SelFile []string // 选中的文件 SelFile []string // 选中的文件
} }
@ -60,7 +60,7 @@ func (f *FileService) Compress(args *ZipBlock, reply *string) error {
logger := util.NewProductionLogger() logger := util.NewProductionLogger()
defer logger.Sync() defer logger.Sync()
// 实际路径 // 实际路径
realFilePath := filepath.Join(config.G.FilePath, args.Curpath) realFilePath := filepath.Join(args.Basepath, args.Curpath)
// zip 文件名 // zip 文件名
zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip" zpFileName := "BIU_" + time.Now().Format("20060102_150405") + ".zip"
// 创建zip 异步? // 创建zip 异步?

Loading…
Cancel
Save