opti: 路由

This commit is contained in:
zwjamnsss 2017-08-11 16:03:11 +08:00
parent 989b2dc83f
commit 16a57c563f
4 changed files with 14 additions and 12 deletions

14
.tags
View File

@ -1,8 +1,3 @@
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ constructor(props) {$/;" function line:26
state.login /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ this.state = {$/;" property line:28
static.checkLoginState /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ componentDidMount() {$/;" function line:45
render /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ render() {$/;" function line:78
from.groupList /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ static propTypes = {$/;" property line:35
state.addGroupModalVisible /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ state = {$/;" property line:46
state.editGroupModalVisible /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ addGroupModalVisible: false,$/;" property line:47
@ -19,9 +14,14 @@ inputNewGroupDesc /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/
selectGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ selectGroup(e) {$/;" function line:151
searchGroup /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ searchGroup(e, value) {$/;" function line:175
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/GroupList/GroupList.js /^ render () {$/;" function line:185
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ constructor(props) {$/;" function line:11
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ render () {$/;" function line:15
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ constructor(props) {$/;" function line:26
state.login /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ this.state = {$/;" property line:28
static.checkLoginState /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ static propTypes = {$/;" property line:33
componentDidMount /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ componentDidMount() {$/;" function line:45
render /Users/qitmac000445/Desktop/YAPI/yapi/client/Application.js /^ render() {$/;" function line:78
from.match /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ static propTypes = {$/;" property line:9
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ constructor(props) {$/;" function line:16
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ componentWillMount() {$/;" function line:20
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ render () {$/;" function line:23
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ constructor(props) {$/;" function line:11
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ render () {$/;" function line:15

6
.tags1
View File

@ -4,5 +4,7 @@
!_TAG_PROGRAM_NAME Exuberant Ctags //
!_TAG_PROGRAM_URL http://ctags.sourceforge.net /official site/
!_TAG_PROGRAM_VERSION 5.8 //
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ constructor(props) {$/;" function line:11
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Group/Group.js /^ render () {$/;" function line:15
from.match /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ static propTypes = {$/;" property line:9
constructor /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ constructor(props) {$/;" function line:16
componentWillMount /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ componentWillMount() {$/;" function line:20
render /Users/qitmac000445/Desktop/YAPI/yapi/client/containers/Project/Project.js /^ render () {$/;" function line:23

View File

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

View File

@ -22,6 +22,7 @@ export default class GroupList extends Component {
render () {
const { match } = this.props;
console.log('project')
return (
<div>
<Subnav
@ -37,8 +38,7 @@ export default class GroupList extends Component {
path: `/project/${match.params.id}/activity`
}]}/>
<Switch>
<Redirect exact from='/project' to='/project/0' />
<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} />