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

This commit is contained in:
wenbo.dong 2017-08-11 16:10:51 +08:00
commit fcba2f35fe
4 changed files with 23 additions and 12 deletions

2
.gitignore vendored
View File

@ -37,3 +37,5 @@ node_modules/
runtime/
prd/
dev/
.tags
.tags1

View File

@ -56,7 +56,7 @@ export default class App extends Component {
<div className="router-main">
<Header />
<div className="router-container">
<Route path="/" component={Home} exact />
<Route exact path="/" component={Home} />
<Route path="/group" component={requireAuthentication(Group)} />
<Route path="/project/:id" component={requireAuthentication(Project)} />
<Route path="/user" component={requireAuthentication(User)} />

View File

@ -2,6 +2,7 @@ import React, { Component } from 'react';
import GroupList from './GroupList/GroupList.js';
import ProjectList from './ProjectList/ProjectList.js';
import Subnav from '../../components/Subnav/Subnav.js';
import { Route, Switch, Redirect } from 'react-router-dom';
import { Row, Col } from 'antd';
import './Group.scss'
@ -12,6 +13,19 @@ export default class Group extends Component {
}
render () {
const GroupContent = (
<div className="g-row">
<Row gutter={16}>
<Col span={6}>
<GroupList></GroupList>
</Col>
<Col span={18}>
<ProjectList/>
</Col>
</Row>
</div>
)
return (
<div>
<Subnav
@ -23,16 +37,10 @@ export default class Group extends Component {
name: '我的关注',
path: '/follow'
}]}/>
<div className="g-row">
<Row gutter={16}>
<Col span={6}>
<GroupList></GroupList>
</Col>
<Col span={18}>
<ProjectList/>
</Col>
</Row>
</div>
<Switch>
<Redirect exact from='/group' to='/group/0' />
<Route path="/group/:groupId" render={() => GroupContent} />
</Switch>
</div>
)
}

View File

@ -22,6 +22,7 @@ export default class GroupList extends Component {
render () {
const { match } = this.props;
console.log('project')
return (
<div>
<Subnav
@ -37,7 +38,7 @@ export default class GroupList extends Component {
path: `/project/${match.params.id}/activity`
}]}/>
<Switch>
<Redirect exact from='/project/:id' to={`/project/${match.params.id}/interface`} />
<Redirect exact from ="/project/:id" to={`/project/${match.params.id}/activity`}/>
<Route path="/project/:id/activity" component={null} />
<Route path="/project/:id/interface" component={Interface} />
<Route path="/project/:id/setting" component={null} />