fix(接口定义): 修复调试缺陷

This commit is contained in:
fit2-zhao 2021-02-26 14:06:13 +08:00
parent e15b1624a8
commit 7e4c7303c4
2 changed files with 11 additions and 7 deletions

View File

@ -2,7 +2,7 @@
<span></span> <span></span>
</template> </template>
<script> <script>
import {getUUID, getBodyUploadFiles, getCurrentProjectID, strMapToObj} from "@/common/js/utils"; import {getUUID, getBodyUploadFiles, getCurrentProjectID, strMapToObj} from "@/common/js/utils";
import ThreadGroup from "./jmeter/components/thread-group"; import ThreadGroup from "./jmeter/components/thread-group";
import TestPlan from "./jmeter/components/test-plan"; import TestPlan from "./jmeter/components/test-plan";
@ -74,7 +74,7 @@ import {getUUID, getBodyUploadFiles, getCurrentProjectID, strMapToObj} from "@/c
// //
projectId = this.runData.projectId; projectId = this.runData.projectId;
} }
let reqObj = {id: this.reportId, testElement: testPlan, type: this.type,projectId:getCurrentProjectID(), environmentMap: strMapToObj(this.envMap)}; let reqObj = {id: this.reportId, testElement: testPlan, type: this.type, projectId: getCurrentProjectID(), environmentMap: strMapToObj(this.envMap)};
let bodyFiles = getBodyUploadFiles(reqObj, this.runData); let bodyFiles = getBodyUploadFiles(reqObj, this.runData);
let url = ""; let url = "";
if (this.debug) { if (this.debug) {

View File

@ -319,6 +319,7 @@ export function _getBodyUploadFiles(request, bodyUploadFiles, obj) {
} }
} }
} }
export function handleCtrlSEvent(event, func) { export function handleCtrlSEvent(event, func) {
if (event.keyCode === 83 && event.ctrlKey) { if (event.keyCode === 83 && event.ctrlKey) {
// console.log('拦截到 ctrl + s');//ctrl+s // console.log('拦截到 ctrl + s');//ctrl+s
@ -329,10 +330,13 @@ export function handleCtrlSEvent(event, func) {
} }
} }
export function strMapToObj(strMap){ export function strMapToObj(strMap) {
let obj= Object.create(null); if (strMap) {
for (let[k,v] of strMap) { let obj = Object.create(null);
for (let [k, v] of strMap) {
obj[k] = v; obj[k] = v;
} }
return obj; return obj;
}
return null;
} }