From 6eabac06b4be86f61c3b5b6e1c3aa5319b8715f9 Mon Sep 17 00:00:00 2001 From: "wenbo.dong" Date: Mon, 31 Jul 2017 11:16:36 +0800 Subject: [PATCH 1/2] =?UTF-8?q?feat:=20=E9=9D=A2=E5=8C=85=E5=B1=91?= =?UTF-8?q?=E5=AF=BC=E8=88=AA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/Application.js | 4 ++-- client/components/Breadcrumb/Breadcrumb.js | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/client/Application.js b/client/Application.js index f473b73d..69203cc4 100644 --- a/client/Application.js +++ b/client/Application.js @@ -6,7 +6,7 @@ import { Home, ProjectGroups, Interface, News, AddInterface } from './containers import User from './containers/User/User.js'; import Header from './components/Header/Header'; import Footer from './components/Footer/Footer'; -// import Breadcrumb from './components/Breadcrumb/Breadcrumb'; +import Breadcrumb from './components/Breadcrumb/Breadcrumb'; import Loading from './components/Loading/Loading'; import { checkLoginState } from './actions/login'; import { requireAuthentication } from './components/AuthenticatedComponent'; @@ -50,7 +50,7 @@ export default class App extends Component {
- {/* */} + diff --git a/client/components/Breadcrumb/Breadcrumb.js b/client/components/Breadcrumb/Breadcrumb.js index 5f440031..8f6df9d3 100644 --- a/client/components/Breadcrumb/Breadcrumb.js +++ b/client/components/Breadcrumb/Breadcrumb.js @@ -28,7 +28,7 @@ export default class BreadcrumbNavigation extends Component { if (/project|group|add-interface/.test(pathSnippets[0])) { let type = pathSnippets[0] === 'add-interface' ? 'interface' : pathSnippets[0], id = pathSnippets[pathSnippets.length-1]; - if (!pathSnippets.includes('edit')) { + if (pathSnippets.includes('add-interface') && !pathSnippets.includes('edit')) { type = 'project'; } const params = { type, id }; @@ -50,12 +50,21 @@ export default class BreadcrumbNavigation extends Component { path: '/project/' + data.project_id }]) }); + // '添加接口'页面:根据project_id获取面包屑路径,并在结尾追加"添加接口" + if (pathSnippets.includes('add-interface') && !pathSnippets.includes('edit')) { + this.setState({ + breadcrumb: this.state.breadcrumb.concat([{ + name: '添加接口', + path: '/add-interface/' + data.project_id + }]) + }); + } } - if (data.interface_name) { + if (data.interface_name && pathSnippets.includes('edit')) { this.setState({ breadcrumb: this.state.breadcrumb.concat([{ name: data.interface_name, - path: '/add-interface/' + data.interface_id + path: '/add-interface/edit/' + data.interface_id }]) }); } From 09d39f9e257d5ba41191e5bd7077f292da21b98c Mon Sep 17 00:00:00 2001 From: sean Date: Mon, 31 Jul 2017 11:18:23 +0800 Subject: [PATCH 2/2] feat: add website title --- static/dev.html | 2 +- static/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/static/dev.html b/static/dev.html index 78ff9a9a..fa5fe0ab 100644 --- a/static/dev.html +++ b/static/dev.html @@ -3,7 +3,7 @@ -my yApi +YAPI-高效、易用、功能强大的api管理平台 diff --git a/static/index.html b/static/index.html index b9adaab7..db8b42cc 100644 --- a/static/index.html +++ b/static/index.html @@ -3,7 +3,7 @@ -my yApi +YAPI-高效、易用、功能强大的api管理平台