From eb4d550305a9bcb35bfca58cdc4e4fe781a481dd Mon Sep 17 00:00:00 2001 From: maoball <115468859+maoball@users.noreply.github.com> Date: Sat, 13 Jul 2024 21:58:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8F=98=E9=87=8F?= =?UTF-8?q?=E5=90=8D=E6=8B=BC=E9=94=99=20(#5792)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fix: 修复变量名拼错 * fix: 修复变量名拼错 * fix: 修复变量名拼错 * fix: 修复变量名拼错 * fix: 修复变量名拼错 --- backend/app/service/file.go | 4 ++-- backend/constant/errs.go | 2 +- backend/i18n/lang/en.yaml | 2 +- backend/i18n/lang/zh-Hant.yaml | 2 +- backend/i18n/lang/zh.yaml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/backend/app/service/file.go b/backend/app/service/file.go index 1581609ec..b48191fc6 100644 --- a/backend/app/service/file.go +++ b/backend/app/service/file.go @@ -183,7 +183,7 @@ func (f *FileService) Create(op request.FileCreate) error { } fo := files.NewFileOp() if fo.Stat(op.Path) { - return buserr.New(constant.ErrFileIsExit) + return buserr.New(constant.ErrFileIsExist) } mode := op.Mode if mode == 0 { @@ -273,7 +273,7 @@ func (f *FileService) ChangeOwner(req request.FileRoleUpdate) error { func (f *FileService) Compress(c request.FileCompress) error { fo := files.NewFileOp() if !c.Replace && fo.Stat(filepath.Join(c.Dst, c.Name)) { - return buserr.New(constant.ErrFileIsExit) + return buserr.New(constant.ErrFileIsExist) } return fo.Compress(c.Files, c.Dst, c.Name, files.CompressType(c.Type), c.Secret) } diff --git a/backend/constant/errs.go b/backend/constant/errs.go index d5429800c..411387d3d 100644 --- a/backend/constant/errs.go +++ b/backend/constant/errs.go @@ -95,7 +95,7 @@ var ( ErrPathNotFound = "ErrPathNotFound" ErrMovePathFailed = "ErrMovePathFailed" ErrLinkPathNotFound = "ErrLinkPathNotFound" - ErrFileIsExit = "ErrFileIsExit" + ErrFileIsExist = "ErrFileIsExist" ErrFileUpload = "ErrFileUpload" ErrFileDownloadDir = "ErrFileDownloadDir" ErrCmdNotFound = "ErrCmdNotFound" diff --git a/backend/i18n/lang/en.yaml b/backend/i18n/lang/en.yaml index d60b0ce09..a3582c69f 100644 --- a/backend/i18n/lang/en.yaml +++ b/backend/i18n/lang/en.yaml @@ -74,7 +74,7 @@ ErrFileToLarge: "file is too large" ErrPathNotFound: "Path is not found" ErrMovePathFailed: "The target path cannot contain the original path!" ErrLinkPathNotFound: "Target path does not exist!" -ErrFileIsExit: "File or directory already exists!" +ErrFileIsExist: "File or directory already exists!" ErrFileUpload: "Failed to upload file {{.name}} {{.detail}}" ErrFileDownloadDir: "Download folder not supported" ErrCmdNotFound: "{{ .name}} command does not exist, please install this command on the host first" diff --git a/backend/i18n/lang/zh-Hant.yaml b/backend/i18n/lang/zh-Hant.yaml index b89c2af6d..56a8e2227 100644 --- a/backend/i18n/lang/zh-Hant.yaml +++ b/backend/i18n/lang/zh-Hant.yaml @@ -75,7 +75,7 @@ ErrFileToLarge: "文件超過10M,無法打開" ErrPathNotFound: "目錄不存在" ErrMovePathFailed: "目標路徑不能包含原路徑!" ErrLinkPathNotFound: "目標路徑不存在!" -ErrFileIsExit: "文件或文件夾已存在!" +ErrFileIsExist: "文件或文件夾已存在!" ErrFileUpload: "{{ .name }} 上傳文件失敗 {{ .detail}}" ErrFileDownloadDir: "不支持下載文件夾" ErrCmdNotFound: "{{ .name}} 命令不存在,請先在宿主機安裝此命令" diff --git a/backend/i18n/lang/zh.yaml b/backend/i18n/lang/zh.yaml index 5961b6482..eca156380 100644 --- a/backend/i18n/lang/zh.yaml +++ b/backend/i18n/lang/zh.yaml @@ -74,7 +74,7 @@ ErrFileToLarge: "文件超过10M,无法打开" ErrPathNotFound: "目录不存在" ErrMovePathFailed: "目标路径不能包含原路径!" ErrLinkPathNotFound: "目标路径不存在!" -ErrFileIsExit: "文件或文件夹已存在!" +ErrFileIsExist: "文件或文件夹已存在!" ErrFileUpload: "{{ .name }} 上传文件失败 {{ .detail}}" ErrFileDownloadDir: "不支持下载文件夹" ErrCmdNotFound: "{{ .name}} 命令不存在,请先在宿主机安装此命令"