From 1e8ba1a62eb4ea70dc86aa5b0e2f1f4e53582216 Mon Sep 17 00:00:00 2001 From: yxh Date: Tue, 12 Sep 2023 22:20:14 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E5=A4=A7=E6=96=87=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=B7=AF=E5=BE=84=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- library/upload_chunk/consts.go | 5 ++--- library/upload_chunk/upload_chunk.go | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/library/upload_chunk/consts.go b/library/upload_chunk/consts.go index 04f799d..7f3db40 100644 --- a/library/upload_chunk/consts.go +++ b/library/upload_chunk/consts.go @@ -1,7 +1,6 @@ package upload_chunk const ( - Tmp = "./resource/public/big_file/" // 文件保存目录 - RelativePath = "big_file/" // 返回前端的相对路径 - FileName = "upfile" // 上传文件的文件名 + RelativePath = "big_file/" // 返回前端的相对路径 + FileName = "upfile" // 上传文件的文件名 ) diff --git a/library/upload_chunk/upload_chunk.go b/library/upload_chunk/upload_chunk.go index bec7656..5699fd8 100644 --- a/library/upload_chunk/upload_chunk.go +++ b/library/upload_chunk/upload_chunk.go @@ -3,6 +3,8 @@ package upload_chunk import ( "errors" "fmt" + "github.com/gogf/gf/v2/frame/g" + "github.com/gogf/gf/v2/os/gctx" "io" "log" "mime/multipart" @@ -207,7 +209,7 @@ func (u *UploadChunk) Upload(uploadReq UploadReq) (result *UpLoadRes, err error) } func (u *UploadChunk) Tmp() string { - return Tmp + return g.Cfg().MustGet(gctx.New(), "server.serverRoot").String() + "/big_file/" // 文件保存目录 } // 合并文件