fix(性能测试): 保证每次从接口测试都能创建新的性能测试

This commit is contained in:
Captain.B 2021-03-25 10:15:33 +08:00
parent 6a45fe5f57
commit 0db75e1b12
1 changed files with 3 additions and 1 deletions

View File

@ -127,7 +127,9 @@ export default {
if (apiTest && apiTest.name) { if (apiTest && apiTest.name) {
this.$set(this.test, "name", apiTest.name); this.$set(this.test, "name", apiTest.name);
let blob = new Blob([apiTest.jmx.xml], {type: "application/octet-stream"}); 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.beforeUploadJmx(file);
this.$refs.basicConfig.handleUpload({file: file}); this.$refs.basicConfig.handleUpload({file: file});
if (JSON.stringify(apiTest.jmx.attachFiles) != "{}") { if (JSON.stringify(apiTest.jmx.attachFiles) != "{}") {