From 0ec30546b39b16cb67ff6a7067ad41157430d00d Mon Sep 17 00:00:00 2001 From: pixelmaxQM Date: Sun, 31 Aug 2025 17:01:21 +0800 Subject: [PATCH] =?UTF-8?q?refactor(breakpoint):=20=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E5=85=A8=E5=B1=80=E7=BF=BB=E8=AF=91=E6=9B=BF=E6=8D=A2=E7=A1=AC?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E9=94=99=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/utils/breakpoint_continue.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/utils/breakpoint_continue.go b/server/utils/breakpoint_continue.go index bce668678..dff990ea8 100644 --- a/server/utils/breakpoint_continue.go +++ b/server/utils/breakpoint_continue.go @@ -5,6 +5,8 @@ import ( "os" "strconv" "strings" + + "github.com/flipped-aurora/gin-vue-admin/server/global" ) // 前端传来文件片与当前片为什么文件的第几片 @@ -56,7 +58,7 @@ func CheckMd5(content []byte, chunkMd5 string) (CanUpload bool) { func makeFileContent(content []byte, fileName string, FileDir string, contentNumber int) (string, error) { if strings.Contains(fileName, "..") || strings.Contains(FileDir, "..") { - return "", errors.New("文件名或路径不合法") + return "", errors.New(global.Translate("breakpoint.invalidFileNameOrPath")) } path := FileDir + fileName + "_" + strconv.Itoa(contentNumber) f, err := os.Create(path)