mirror of
https://github.com/YMFE/yapi.git
synced 2024-12-09 05:00:30 +08:00
Merge branch 'dev' of gitlab.corp.qunar.com:mfe/yapi into dev
This commit is contained in:
commit
60d305061e
@ -6,7 +6,7 @@ import { Home, ProjectGroups, Interface, News, AddInterface } from './containers
|
|||||||
import User from './containers/User/User.js';
|
import User from './containers/User/User.js';
|
||||||
import Header from './components/Header/Header';
|
import Header from './components/Header/Header';
|
||||||
import Footer from './components/Footer/Footer';
|
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 Loading from './components/Loading/Loading';
|
||||||
import { checkLoginState } from './actions/login';
|
import { checkLoginState } from './actions/login';
|
||||||
import { requireAuthentication } from './components/AuthenticatedComponent';
|
import { requireAuthentication } from './components/AuthenticatedComponent';
|
||||||
@ -50,7 +50,7 @@ export default class App extends Component {
|
|||||||
<div className="router-main">
|
<div className="router-main">
|
||||||
<Header />
|
<Header />
|
||||||
<div className="router-container">
|
<div className="router-container">
|
||||||
{/* <Breadcrumb /> */}
|
<Breadcrumb />
|
||||||
<Route path="/" component={Home} exact />
|
<Route path="/" component={Home} exact />
|
||||||
<Switch>
|
<Switch>
|
||||||
<Redirect exact from='/group' to='/group/1' />
|
<Redirect exact from='/group' to='/group/1' />
|
||||||
|
@ -28,7 +28,7 @@ export default class BreadcrumbNavigation extends Component {
|
|||||||
if (/project|group|add-interface/.test(pathSnippets[0])) {
|
if (/project|group|add-interface/.test(pathSnippets[0])) {
|
||||||
let type = pathSnippets[0] === 'add-interface' ? 'interface' : pathSnippets[0],
|
let type = pathSnippets[0] === 'add-interface' ? 'interface' : pathSnippets[0],
|
||||||
id = pathSnippets[pathSnippets.length-1];
|
id = pathSnippets[pathSnippets.length-1];
|
||||||
if (!pathSnippets.includes('edit')) {
|
if (pathSnippets.includes('add-interface') && !pathSnippets.includes('edit')) {
|
||||||
type = 'project';
|
type = 'project';
|
||||||
}
|
}
|
||||||
const params = { type, id };
|
const params = { type, id };
|
||||||
@ -50,12 +50,21 @@ export default class BreadcrumbNavigation extends Component {
|
|||||||
path: '/project/' + data.project_id
|
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({
|
this.setState({
|
||||||
breadcrumb: this.state.breadcrumb.concat([{
|
breadcrumb: this.state.breadcrumb.concat([{
|
||||||
name: data.interface_name,
|
name: data.interface_name,
|
||||||
path: '/add-interface/' + data.interface_id
|
path: '/add-interface/edit/' + data.interface_id
|
||||||
}])
|
}])
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<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">
|
<link rel="stylesheet" href="http://127.0.0.1:4000/yapi/prd/index@dev.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||||
<title>my yApi</title>
|
<title>YAPI-高效、易用、功能强大的api管理平台</title>
|
||||||
<script>
|
<script>
|
||||||
document.write('<script src="prd/assets.js?v=' + Math.random() + '"><\/script>');
|
document.write('<script src="prd/assets.js?v=' + Math.random() + '"><\/script>');
|
||||||
console.log(window)
|
console.log(window)
|
||||||
|
Loading…
Reference in New Issue
Block a user