swagger已实现文档的参数和返回值查看

This commit is contained in:
暮光:城中城
2021-10-28 23:25:12 +08:00
parent 3a695ebd1a
commit 59ecaf4477
14 changed files with 869 additions and 206 deletions

View File

@@ -75,6 +75,11 @@
if (matched.length >= 1) {
this.openKeys = [matched[1].path];
}
// 加载初始化的地址
if (this.$route.path === '/doc/view' && this.$route.query.url) {
this.swaggerDocChoice = this.$route.query.url;
this.swaggerDocChoiceChange();
}
this.getSwaggerResourceList();
},
methods: {
@@ -111,10 +116,10 @@
}
this.$store.commit('setSwaggerDoc', v2Doc);
let metaInfo = {url};
let treeData = createTreeViewByTag(v2Doc);
this.treeData = getTreeDataForTag(v2Doc, treeData.pathIndex, metaInfo);
this.$store.commit('setSwaggerTreePathMap', treeData.treePathDataMap);
setTimeout(() => this.treeDataLoading = false, 300);
let treeData = createTreeViewByTag(v2Doc, '');
this.treeData = getTreeDataForTag(v2Doc, treeData.pathData, metaInfo);
this.$store.commit('setSwaggerTreePathMap', treeData.pathDataMap);
setTimeout(() => this.treeDataLoading = false, 100);
});
},
toJsonObj(value) {