Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev

This commit is contained in:
waliang.wang 2017-07-31 11:26:36 +08:00
commit 60d305061e
4 changed files with 16 additions and 7 deletions

View File

@ -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 {
<div className="router-main">
<Header />
<div className="router-container">
{/* <Breadcrumb /> */}
<Breadcrumb />
<Route path="/" component={Home} exact />
<Switch>
<Redirect exact from='/group' to='/group/1' />

View File

@ -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
}])
});
}

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>my yApi</title>
<title>YAPI-高效、易用、功能强大的api管理平台</title>
<link rel="stylesheet" href="http://127.0.0.1:4000/yapi/prd/index@dev.css">
</head>
<body>

View File

@ -3,7 +3,7 @@
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>my yApi</title>
<title>YAPI-高效、易用、功能强大的api管理平台</title>
<script>
document.write('<script src="prd/assets.js?v=' + Math.random() + '"><\/script>');
console.log(window)