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}} 命令不存在,请先在宿主机安装此命令"