fix: 修复url参数是否必填不显示的问题

修复url参数是否必填不显示的问题
This commit is contained in:
song-tianyang 2021-06-17 17:21:48 +08:00 committed by 刘瑞斌
parent 3f99bf02ae
commit 45dfbba11f
2 changed files with 13 additions and 4 deletions

View File

@ -121,7 +121,7 @@ public class ApiDocumentService {
JSONArray headArr = requestObj.getJSONArray("rest");
for (int index = 0; index < headArr.size(); index++) {
JSONObject headObj = headArr.getJSONObject(index);
if (headObj.containsKey("name") && headObj.containsKey("value")) {
if (headObj.containsKey("name")) {
urlParamArr.add(headObj);
}
}
@ -176,9 +176,13 @@ public class ApiDocumentService {
Map<String, String> previewObjMap = new LinkedHashMap<>();
for (int i = 0; i < kvsArr.size(); i++) {
JSONObject kv = kvsArr.getJSONObject(i);
if (kv.containsKey("name") && kv.containsKey("value")) {
if (kv.containsKey("name")) {
String value = "";
if(kv.containsKey("value")){
value = String.valueOf(kv.get("value"));
}
bodyParamArr.add(kv);
previewObjMap.put(String.valueOf(kv.get("name")), String.valueOf(kv.get("value")));
previewObjMap.put(String.valueOf(kv.get("name")), value);
}
}
this.setPreviewData(previewJsonArray, JSONObject.toJSONString(previewObjMap));

View File

@ -131,8 +131,13 @@
:label="$t('api_test.definition.document.table_coloum.name')"
min-width="120px"
show-overflow-tooltip/>
<el-table-column prop="isEnable"
<!-- <el-table-column prop="isEnable"-->
<!-- :label="$t('api_test.definition.document.table_coloum.is_required')"-->
<!-- min-width="80px"-->
<!-- show-overflow-tooltip/>-->
<el-table-column prop="required"
:label="$t('api_test.definition.document.table_coloum.is_required')"
:formatter="formatBoolean"
min-width="80px"
show-overflow-tooltip/>
<el-table-column prop="value"