From f912c5c0b8615c1c6c53e46ccb3ef652a5a433a8 Mon Sep 17 00:00:00 2001 From: song-cc-rock Date: Wed, 15 Nov 2023 10:41:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=B5=8B=E8=AF=95=E8=B7=9F=E8=B8=AA):=20?= =?UTF-8?q?=E7=94=A8=E4=BE=8B=E7=BC=BA=E9=99=B7=E9=99=84=E4=BB=B6=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E9=99=90=E5=88=B6=E4=B8=BA50MB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1032752 --user=宋昌昌 【测试跟踪】github#27480,功能用例上传附件接口提示是不超过500M,实际上传200M的文件接口会报错 https://www.tapd.cn/55049933/s/1436598 --- .../case/CaseAttachmentComponent.vue | 2 +- .../src/business/issue/IssueEditDetail.vue | 49 ++++++++++--------- 2 files changed, 26 insertions(+), 25 deletions(-) diff --git a/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue b/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue index 4d4da9cfb3..ab0bd98044 100644 --- a/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue +++ b/test-track/frontend/src/business/case/components/case/CaseAttachmentComponent.vue @@ -200,7 +200,7 @@ export default { * upload file methods */ fileValidator(file) { - return file.size < 500 * 1024 * 1024; + return file.size < 50 * 1024 * 1024; }, beforeUpload(file) { if (!this.fileValidator(file)) { diff --git a/test-track/frontend/src/business/issue/IssueEditDetail.vue b/test-track/frontend/src/business/issue/IssueEditDetail.vue index df374e6c2e..2e9f8dbe68 100644 --- a/test-track/frontend/src/business/issue/IssueEditDetail.vue +++ b/test-track/frontend/src/business/issue/IssueEditDetail.vue @@ -343,31 +343,31 @@ import TestCaseIssueList from "@/business/issue/TestCaseIssueList"; import IssueEditDetail from "@/business/issue/IssueEditDetail"; import {byteToSize, getTypeByFileName, getUUID,} from "metersphere-frontend/src/utils"; import { - getCurrentProjectID, - getCurrentUser, - getCurrentUserId, - getCurrentWorkspaceId, + getCurrentProjectID, + getCurrentUser, + getCurrentUserId, + getCurrentWorkspaceId, } from "metersphere-frontend/src/utils/token"; import {hasLicense, hasPermission,} from "metersphere-frontend/src/utils/permission"; import { - enableThirdPartTemplate, - getComments, - getFollow, - getIssuePartTemplateWithProject, - getPlatformFormOption, - getPlatformTransitions, - getTapdCurrentOwner, - getTapdUser, - saveFollow, - saveOrUpdateIssue, + enableThirdPartTemplate, + getComments, + getFollow, + getIssuePartTemplateWithProject, + getPlatformFormOption, + getPlatformTransitions, + getTapdCurrentOwner, + getTapdUser, + saveFollow, + saveOrUpdateIssue, } from "@/api/issue"; import { - attachmentList, - deleteIssueAttachment, - dumpAttachment, - relatedIssueAttachment, - unrelatedIssueAttachment, - uploadIssueAttachment, + attachmentList, + deleteIssueAttachment, + dumpAttachment, + relatedIssueAttachment, + unrelatedIssueAttachment, + uploadIssueAttachment, } from "@/api/attachment"; import CustomFiledFormItem from "metersphere-frontend/src/components/form/CustomFiledFormItem"; import MsMarkDownText from "metersphere-frontend/src/components/MsMarkDownText"; @@ -856,16 +856,16 @@ export default { } }, fileValidator(file) { - return file.size < 500 * 1024 * 1024; + return file.size < 50 * 1024 * 1024; }, beforeUpload(file) { if (!this.fileValidator(file)) { - this.$error(this.$t("load_test.file_size_out_of_bounds") + file.name); + this.$error(this.$t("case.file_size_out_of_bounds"), false); return false; } if (this.tableData.filter((f) => f.name === file.name).length > 0) { - this.$error(this.$t("load_test.delete_file") + ", name: " + file.name); + this.$error(this.$t("load_test.delete_file") + ", name: " + file.name, false); return false; } }, @@ -917,6 +917,7 @@ export default { progress = 100; param.onSuccess(response); progressCallback({ progress, status: "success" }); + self.$success(this.$t('attachment.upload_success'), false) self.cancelFileToken.forEach((token, index, array) => { if (token.name == file.name) { array.splice(token, 1); @@ -1011,7 +1012,7 @@ export default { this.filterCopyFiles.push(file.id); } else { deleteIssueAttachment(file.id).then(() => { - this.$success(this.$t("commons.delete_success")); + this.$success(this.$t("commons.delete_success"), false); this.getFileMetaData(this.issueId); }); }