diff --git a/client/components/Header/Header.js b/client/components/Header/Header.js
index 8fb4ee8c..5fdf4db6 100644
--- a/client/components/Header/Header.js
+++ b/client/components/Header/Header.js
@@ -2,14 +2,13 @@ import './Header.scss'
import React, { Component } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
-import { Link } from 'react-router-dom'
+import { Link, withRouter } from 'react-router-dom'
import { Icon, Layout, Menu} from 'antd'
import { logoutActions, loginTypeAction} from '../../actions/login'
const { Header } = Layout;
const ToolUser = (props)=> (
- - 帮助
- { props.user }
- { props.msg }
- 退出
@@ -22,16 +21,7 @@ ToolUser.propTypes={
logout:PropTypes.func
};
-const ToolGuest = ()=> (
-
-);
-ToolGuest.propTypes={
- onLogin:PropTypes.func,
- onReg:PropTypes.func
-}
-
+@withRouter
class HeaderCom extends Component {
constructor(props) {
super(props);
@@ -43,10 +33,15 @@ class HeaderCom extends Component {
user: PropTypes.string,
msg: PropTypes.string,
login:PropTypes.bool,
+ router: PropTypes.object,
relieveLink:PropTypes.func,
logoutActions:PropTypes.func,
loginTypeAction:PropTypes.func
}
+ componentDidMount() {
+ const { router } = this.props;
+ console.log(router);
+ }
linkTo = (e) =>{
this.setState({
current : e.key
@@ -96,9 +91,12 @@ class HeaderCom extends Component {
接口
+
+ 文档
+
- {login?:}
+ {login?:""}
diff --git a/client/containers/Home/Home.js b/client/containers/Home/Home.js
index dcc60785..d989801b 100644
--- a/client/containers/Home/Home.js
+++ b/client/containers/Home/Home.js
@@ -1,52 +1,79 @@
import './Home.scss'
import React, { Component } from 'react'
-import { Row, Col } from 'antd'
+import { connect } from 'react-redux'
+import { Row, Col, Button } from 'antd'
import PropTypes from "prop-types"
import Login from '../Login/login-wrap'
import Intro from '../../components/Intro/Intro'
+import Footer from "../../components/Footer/Footer";
+const HomeGuest = (props) => (
+
+
+
+
+
+
+
YAPI
+
一个高效,易用,功能强大的api管理系统
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { props.introList.map(function(intro,i){
+ return (
+
+ )
+ })}
+
+);
+HomeGuest.propTypes ={
+ introList: PropTypes.array
+}
+
+@connect(
+ state => ({
+ login: state.login.isLogin
+ })
+)
class Home extends Component {
constructor(props) {
super(props)
}
static propTypes = {
- introList:PropTypes.array
+ introList: PropTypes.array,
+ login : PropTypes.bool
}
render () {
+ const { login } = this.props;
return (
-
-
-
-
-
-
YAPI
-
一个高效,易用,功能强大的api管理系统
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- { this.props.introList.map(function(intro,i){
- return (
-
-
-
+ {login?
+ (
+
- )
- })}
+
+ )
+ :
}
+
)
}