swagger文档展示优化,调试页面开发

This commit is contained in:
暮光:城中城
2021-10-31 23:48:55 +08:00
parent 9fcdfb7758
commit 7b4c1ae455
18 changed files with 383 additions and 93 deletions

View File

@@ -83,7 +83,9 @@ export function getTreeDataForTag(swagger, pathData, keywords, metaInfo) {
});
indexUrl++;
});
treeData.push({title: tag.name, key: indexTag, children: urlTree});
if (urlTree.length > 0) {
treeData.push({title: tag.name, key: indexTag, children: urlTree});
}
indexTag++;
});
return [
@@ -105,6 +107,6 @@ function searchInPathMethods(url, methodNode, keywords) {
if (url.indexOf(keywords) >= 0) {
return true;
}
let searchData = methodNode.path + methodNode.summary + methodNode.description + methodNode.tags;
let searchData = methodNode.path + methodNode.method + methodNode.summary + methodNode.description + methodNode.tags;
return (searchData && searchData.toLowerCase().indexOf(keywords) >= 0);
}