diff --git a/api-test/frontend/src/business/definition/components/esb/EsbResponseResult.vue b/api-test/frontend/src/business/definition/components/esb/EsbResponseResult.vue
index 22cff9715f..d603391622 100644
--- a/api-test/frontend/src/business/definition/components/esb/EsbResponseResult.vue
+++ b/api-test/frontend/src/business/definition/components/esb/EsbResponseResult.vue
@@ -214,7 +214,7 @@ export default {
':\n' +
this.response.headers +
'\n' +
- 'Cookies :\n' +
+ 'Cookie :' +
this.response.cookies +
'\n' +
'Body:' +
diff --git a/api-test/frontend/src/business/definition/components/mock/Components/MockResponseParam.vue b/api-test/frontend/src/business/definition/components/mock/Components/MockResponseParam.vue
index 8ad92e906c..326cff89a1 100644
--- a/api-test/frontend/src/business/definition/components/mock/Components/MockResponseParam.vue
+++ b/api-test/frontend/src/business/definition/components/mock/Components/MockResponseParam.vue
@@ -234,7 +234,7 @@ export default {
':\n' +
this.response.headers +
'\n' +
- 'Cookies :\n' +
+ 'Cookie :' +
this.response.cookies +
'\n' +
'Body:' +
diff --git a/api-test/frontend/src/business/definition/components/response/ResponseResult.vue b/api-test/frontend/src/business/definition/components/response/ResponseResult.vue
index fbe3eb5b38..7320ce1a3e 100644
--- a/api-test/frontend/src/business/definition/components/response/ResponseResult.vue
+++ b/api-test/frontend/src/business/definition/components/response/ResponseResult.vue
@@ -166,7 +166,7 @@ export default {
}
if (this.response.cookies) {
- this.reqMessages += 'Cookies :\n' + this.response.cookies + '\n';
+ this.reqMessages += 'Cookie :' + this.response.cookies + '\n';
}
this.reqMessages += 'Body:' + '\n' + this.response.body;
}
diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ResponseResult.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ResponseResult.vue
index 02ae536328..d7a0d1ce3d 100644
--- a/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ResponseResult.vue
+++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/api/ResponseResult.vue
@@ -1,43 +1,124 @@
-
-
-
+
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
-
+
+
-
+
-
-
+
+
@@ -48,7 +129,7 @@
import MsAssertionResults from "../ui/AssertionResults";
import MsCodeEdit from "metersphere-frontend/src/components/MsCodeEdit";
import MsDropdown from "metersphere-frontend/src/components/MsDropdown";
-import {BODY_FORMAT} from "metersphere-frontend/src/model/ApiTestModel";
+import { BODY_FORMAT } from "metersphere-frontend/src/model/ApiTestModel";
import MsSqlResultTable from "./SqlResultTable";
export default {
@@ -58,7 +139,7 @@ export default {
MsDropdown,
MsCodeEdit,
MsAssertionResults,
- MsSqlResultTable
+ MsSqlResultTable,
},
props: {
@@ -68,26 +149,26 @@ export default {
type: Boolean,
default() {
return false;
- }
- }
+ },
+ },
},
data() {
return {
isActive: true,
activeName: "body",
- modes: ['text', 'json', 'xml', 'html'],
- sqlModes: ['text', 'table'],
+ modes: ["text", "json", "xml", "html"],
+ sqlModes: ["text", "table"],
mode: BODY_FORMAT.TEXT,
isMsCodeEditShow: true,
reqMessages: "",
- }
+ };
},
watch: {
response() {
this.setBodyType();
this.setReqMessage();
- }
+ },
},
methods: {
modeChange(mode) {
@@ -97,15 +178,21 @@ export default {
this.mode = mode;
},
setBodyType() {
- if (this.response && this.response.responseResult && this.response.responseResult.headers
- && this.response.responseResult.headers.indexOf("Content-Type: application/json") > 0) {
+ if (
+ this.response &&
+ this.response.responseResult &&
+ this.response.responseResult.headers &&
+ this.response.responseResult.headers.indexOf(
+ "Content-Type: application/json"
+ ) > 0
+ ) {
this.mode = BODY_FORMAT.JSON;
this.$nextTick(() => {
if (this.$refs.modeDropdown) {
this.$refs.modeDropdown.handleCommand(BODY_FORMAT.JSON);
this.msCodeReload();
}
- })
+ });
}
},
msCodeReload() {
@@ -134,9 +221,21 @@ export default {
if (!this.response.responseResult.vars) {
this.response.responseResult.vars = "";
}
- this.reqMessages = this.$t('api_test.request.address') + ":\n" + this.response.url + "\n" +
- this.$t('api_test.scenario.headers') + ":\n" + this.response.headers + "\n" + "Cookies :\n" +
- this.response.cookies + "\n" + "Body:" + "\n" + this.response.body;
+ this.reqMessages =
+ this.$t("api_test.request.address") +
+ ":\n" +
+ this.response.url +
+ "\n" +
+ this.$t("api_test.scenario.headers") +
+ ":\n" +
+ this.response.headers +
+ "\n" +
+ "Cookie :\n" +
+ this.response.cookies +
+ "\n" +
+ "Body:" +
+ "\n" +
+ this.response.body;
}
},
},
@@ -146,13 +245,19 @@ export default {
},
computed: {
isSqlType() {
- return (this.currentProtocol === "SQL" && this.response.responseResult.responseCode === '200' && this.mode === 'table');
+ return (
+ this.currentProtocol === "SQL" &&
+ this.response.responseResult.responseCode === "200" &&
+ this.mode === "table"
+ );
},
responseResult() {
- return this.response && this.response.responseResult ? this.response.responseResult : {};
- }
- }
-}
+ return this.response && this.response.responseResult
+ ? this.response.responseResult
+ : {};
+ },
+ },
+};