fix(接口测试): 修复接口案例全屏优化遗漏的部分

--bug=1010475 --user=宋天阳 【接口测试】case全屏优化遗漏部分
https://www.tapd.cn/55049933/s/1107408
This commit is contained in:
song-tianyang 2022-02-22 14:06:33 +08:00 committed by xiaomeinvG
parent 69b57856cc
commit 89f9c2603e
5 changed files with 106 additions and 74 deletions

View File

@ -235,6 +235,7 @@ public class MockApiUtils {
if (StringUtils.isNotEmpty(response)) {
try {
JSONObject respObj = JSONObject.parseObject(response);
if(respObj != null){
if (respObj.containsKey("body")) {
String returnStr = "";
JSONObject bodyObj = respObj.getJSONObject("body");
@ -324,6 +325,7 @@ public class MockApiUtils {
}
responseDTO.setHeaders(headMap);
}
}
} catch (Exception e) {
MSException.throwException(e);
}

View File

@ -140,6 +140,11 @@ export default {
this.getApiTest(true);
this.visible = true;
this.$store.state.currentApiCase = undefined;
//
this.$nextTick(() => {
this.$refs.testCaseDrawer.setfullScreen();
});
},
add(api) {
this.api = api;
@ -169,6 +174,11 @@ export default {
this.condition = {components: API_CASE_CONFIGS};
this.sysAddition(apiCase);
this.visible = true;
//
this.$nextTick(() => {
this.$refs.testCaseDrawer.setfullScreen();
});
},
runTestCase(api, testCaseId) {
if (api && testCaseId) {
@ -195,6 +205,11 @@ export default {
this.api = api;
this.currentApi = api;
this.addCase();
//
this.$nextTick(() => {
this.$refs.testCaseDrawer.setfullScreen();
});
},
setEnvironment(environment) {
this.environment = environment;

View File

@ -34,6 +34,7 @@ import MsDropdown from "@/business/components/common/components/MsDropdown";
import CustomFunctionRelate from "@/business/components/project/menu/function/CustomFunctionRelate";
import ApiFuncRelevance from "@/business/components/project/menu/function/ApiFuncRelevance";
import MockScriptNavMenu from "@/business/components/api/definition/components/mock/Components/MockScriptNavMenu";
import i18n from "@/i18n/i18n";
export default {
name: "MockApiScriptEditor",
@ -112,6 +113,19 @@ export default {
]
},
{
title: i18n.t('project.code_segment.custom_value'),
children: [
{
title: i18n.t('api_test.request.processor.code_template_get_variable'),
value: 'vars.get("variable_name");',
},
{
title: i18n.t('api_test.request.processor.code_template_set_variable'),
value: 'vars.put("variable_name", "variable_value");',
},
]
},
{
title: this.$t('project.code_segment.code_segment'),
children: [

View File

@ -3,6 +3,7 @@
<el-card>
<el-row>
<el-col :span="1">
<span style="color: #f56c6c">*</span>
{{ $t('commons.name') }}
</el-col>
<el-col :span="9">

View File

@ -20,7 +20,7 @@
:screen-height="screenHeight"
@row-click="clickRow"
row-key="id"
operator-width="120px"
operator-width="170px"
ref="table"
>