From 0db75e1b12c574f72cac2e3777bcac608537611a Mon Sep 17 00:00:00 2001 From: "Captain.B" Date: Thu, 25 Mar 2021 10:15:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=9D=E8=AF=81=E6=AF=8F=E6=AC=A1=E4=BB=8E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=83=BD=E8=83=BD=E5=88=9B=E5=BB=BA=E6=96=B0?= =?UTF-8?q?=E7=9A=84=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/performance/test/EditPerformanceTest.vue | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/business/components/performance/test/EditPerformanceTest.vue b/frontend/src/business/components/performance/test/EditPerformanceTest.vue index 30168db9c5..656a867d25 100644 --- a/frontend/src/business/components/performance/test/EditPerformanceTest.vue +++ b/frontend/src/business/components/performance/test/EditPerformanceTest.vue @@ -127,7 +127,9 @@ export default { if (apiTest && apiTest.name) { this.$set(this.test, "name", apiTest.name); let blob = new Blob([apiTest.jmx.xml], {type: "application/octet-stream"}); - let file = new File([blob], apiTest.jmx.name); + let suffixIndex = apiTest.jmx.name.lastIndexOf(".jmx"); + let jmxName = apiTest.jmx.name.substring(0, suffixIndex) + "_" + new Date().getTime() + ".jmx"; + let file = new File([blob], jmxName); // 保证每次从接口测试都能创建新的性能测试 this.$refs.basicConfig.beforeUploadJmx(file); this.$refs.basicConfig.handleUpload({file: file}); if (JSON.stringify(apiTest.jmx.attachFiles) != "{}") {