fix(Mock自定义脚本): 修复Mock期望填写时存在的样式问题

修复Mock期望填写时存在的样式问题
This commit is contained in:
song-tianyang 2021-10-21 15:05:40 +08:00 committed by song-tianyang
parent 21331112db
commit 505a990107
3 changed files with 10 additions and 6 deletions

View File

@ -651,7 +651,11 @@ public class MockConfigService {
returnStr = MockApiUtils.getResultByResponseResult(responseJsonObj.getJSONObject("body"), url, headerMap, requestMockParams); returnStr = MockApiUtils.getResultByResponseResult(responseJsonObj.getJSONObject("body"), url, headerMap, requestMockParams);
} }
if (responseJsonObj.containsKey("httpCode")) { if (responseJsonObj.containsKey("httpCode")) {
response.setStatus(Integer.parseInt(responseJsonObj.getString("httpCode"))); int httpCodeNum = 500;
try {
httpCodeNum = Integer.parseInt(responseJsonObj.getString("httpCode"));
}catch (Exception e){}
response.setStatus(httpCodeNum);
} }
if (responseJsonObj.containsKey("delayed")) { if (responseJsonObj.containsKey("delayed")) {
try { try {

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<el-row type="flex" :gutter="10"> <el-row type="flex">
<el-col :span="codeSpan" class="script-content"> <el-col :span="codeSpan" class="script-content">
<ms-code-edit v-if="isCodeEditAlive" :mode="codeEditModeMap[jsr223ProcessorData.scriptLanguage]" <ms-code-edit v-if="isCodeEditAlive" :mode="codeEditModeMap[jsr223ProcessorData.scriptLanguage]"
:read-only="isReadOnly" :read-only="isReadOnly"
@ -15,10 +15,10 @@
@click="switchMenu"></i> @click="switchMenu"></i>
</div> </div>
</div> </div>
<el-col :span="menuSpan" class="script-index"> <el-col :span="menuSpan" style="width: 200px" class="script-index">
<ms-dropdown :default-command="jsr223ProcessorData.scriptLanguage" :commands="languages" style="margin-bottom: 5px;margin-left: 15px;" <ms-dropdown :default-command="jsr223ProcessorData.scriptLanguage" :commands="languages" style="margin-bottom: 5px;margin-left: 15px;"
@command="languageChange"/> @command="languageChange"/>
<mock-script-nav-menu ref="scriptNavMenu" :language="jsr223ProcessorData.scriptLanguage" :menus="baseCodeTemplates" <mock-script-nav-menu ref="scriptNavMenu" style="width: 90%" :language="jsr223ProcessorData.scriptLanguage" :menus="baseCodeTemplates"
@handleCode="handleCodeTemplate"/> @handleCode="handleCodeTemplate"/>
</el-col> </el-col>
</el-row> </el-row>

View File

@ -5,7 +5,7 @@
<el-collapse-transition> <el-collapse-transition>
<el-tabs v-model="activeName" v-show="isActive" style="margin: 20px"> <el-tabs v-model="activeName" v-show="isActive" style="margin: 20px">
<el-tab-pane v-if="!isTcp" :label="$t('api_test.definition.request.response_header')" name="headers" class="pane"> <el-tab-pane v-if="!isTcp" :label="$t('api_test.definition.request.response_header')" name="headers" class="pane">
<ms-api-key-value :isShowEnable="false" :suggestions="headerSuggestions" :items="response.headers"/> <ms-api-key-value style="width: 95%" :isShowEnable="false" :suggestions="headerSuggestions" :items="response.headers"/>
</el-tab-pane> </el-tab-pane>
<el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane"> <el-tab-pane :label="$t('api_test.definition.request.response_body')" name="body" class="pane">
<mock-api-response-body :isReadOnly="false" :isShowEnable="false" :api-id="apiId" :body="response.body" :headers="response.headers"/> <mock-api-response-body :isReadOnly="false" :isShowEnable="false" :api-id="apiId" :body="response.body" :headers="response.headers"/>
@ -15,7 +15,7 @@
<el-row> <el-row>
<el-col :span="2"/> <el-col :span="2"/>
<el-col :span="20"> <el-col :span="20">
<el-input class="ms-http-input" size="small" v-model="response.httpCode"/> <el-input size="small" style="width: 180px;margin-top: 10px" v-model="response.httpCode"/>
</el-col> </el-col>
<el-col :span="2"/> <el-col :span="2"/>
</el-row> </el-row>