Skip to content

Commit

Permalink
基本路径bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
follow-my-heart committed Jul 16, 2019
1 parent ced2764 commit aa45aaa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion customizeSwagger/customizeSwagger.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,13 @@ export default class ProjectInterfaceSync extends Component {
let interfaceList = [];
data.forEach(controller => {
controller.list.forEach(item => {
interfaceList.push(`${basepath}${item.path}`)
let path = item.path
// 处理baseUrl
if (basepath) {
path = item.path.indexOf(basepath) === 0 ? item.path.substr(basepath.length) : path;
path = `${basepath}${path}`
}
interfaceList.push(path)
})
});
this.setState({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"key": "yapi-plugin",
"name": "yapi-plugin-import-swagger-customize",
"version": "2.0.2",
"version": "2.0.3",
"description": "yapi自定义导入插件",
"main": "index.js",
"keywords": [
Expand Down

0 comments on commit aa45aaa

Please sign in to comment.