mirror of
https://github.com/zuiidea/antd-admin
synced 2026-11-27 08:14:06 +00:00
error page
This commit is contained in:
@@ -1,25 +1,17 @@
|
||||
import React, { PropTypes } from 'react'
|
||||
import { Menu, Icon } from 'antd'
|
||||
import { Link } from 'dva/router'
|
||||
import React, {PropTypes} from 'react'
|
||||
import {Menu, Icon} from 'antd'
|
||||
import {Link} from 'dva/router'
|
||||
import styles from './main.less'
|
||||
|
||||
const SubMenu = Menu.SubMenu
|
||||
|
||||
function getMenuKeyFromUrl(pathname) {
|
||||
let key = ''
|
||||
try {
|
||||
key = pathname.match(/\/([^\/]*)/i)[1]
|
||||
/* eslint no-empty:0 */
|
||||
} catch (e) {}
|
||||
return key
|
||||
}
|
||||
|
||||
function Header({ location }) {
|
||||
console.log(getMenuKeyFromUrl(location.pathname),location.pathname);
|
||||
function Header({location}) {
|
||||
return (
|
||||
<div className={styles.header}>
|
||||
<Menu className="header-menu" mode="horizontal">
|
||||
<SubMenu style={{float:'right'}} title={<span><Icon type="user" />吴彦祖</span>}>
|
||||
<SubMenu style={{
|
||||
float: 'right'
|
||||
}} title={< span > <Icon type="user"/>吴彦祖 < /span>}>
|
||||
<Menu.Item key="signOut">
|
||||
<a>注销</a>
|
||||
</Menu.Item>
|
||||
@@ -30,7 +22,7 @@ function Header({ location }) {
|
||||
}
|
||||
|
||||
Header.propTypes = {
|
||||
location: PropTypes.object,
|
||||
location: PropTypes.object
|
||||
}
|
||||
|
||||
export default Header
|
||||
|
||||
@@ -2,16 +2,8 @@ import React, {PropTypes} from 'react'
|
||||
import styles from './main.less'
|
||||
import {config} from '../../utils'
|
||||
|
||||
function Footer({location}) {
|
||||
return (
|
||||
<div className={styles.footer}>
|
||||
{config.footerText}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Footer.propTypes = {
|
||||
location: PropTypes.object
|
||||
}
|
||||
const Footer = () => <div className={styles.footer}>
|
||||
{config.footerText}
|
||||
</div>
|
||||
|
||||
export default Footer
|
||||
|
||||
Reference in New Issue
Block a user