diff --git a/src/components/Authorized/AuthorizedRoute.js b/src/components/Authorized/AuthorizedRoute.js index 60b45dc9717c54b09486c44f81777590d7ffe015..7534fabc27ba9e46e6dbb98609b95191cc8d4ea6 100644 --- a/src/components/Authorized/AuthorizedRoute.js +++ b/src/components/Authorized/AuthorizedRoute.js @@ -4,6 +4,7 @@ import Authorized from './Authorized'; class AuthorizedRoute extends React.Component { render() { + // TODO: umi只会返回render和rest const { component: Component, render, authority, redirectPath, ...rest } = this.props; return ( 2018 蚂蚁金服体验技术部出品 ); - -function getLoginPathWithRedirectPath() { - const params = getPageQuery(); - const { redirect } = params; - return getQueryPath('/user/login', { - redirect, - }); -} +// TODO:remove +// function getLoginPathWithRedirectPath() { +// const params = getPageQuery(); +// const { redirect } = params; +// return getQueryPath('/user/login', { +// redirect, +// }); +// } class UserLayout extends React.PureComponent { getPageTitle() { @@ -51,7 +53,7 @@ class UserLayout extends React.PureComponent { } render() { - const { routerData, match } = this.props; + const { children } = this.props; return (
@@ -65,7 +67,8 @@ class UserLayout extends React.PureComponent {
Ant Design 是西湖区最具影响力的 Web 设计规范
- + {children} + {/* {getRoutes(match.path, routerData).map(item => ( ))} - + */} diff --git a/src/pages/User/Login.js b/src/pages/User/Login.js index 2fc3e9d528bfca5c2525f50bc3682a166955b459..25caea1ae32ad4765b4df59a800a3bc2aca74732 100644 --- a/src/pages/User/Login.js +++ b/src/pages/User/Login.js @@ -112,7 +112,7 @@ export default class LoginPage extends Component { - + 注册账户 diff --git a/src/pages/User/Register.js b/src/pages/User/Register.js index 6f608952234837181c4e1226f9b1638dd5c7d1fe..10273314c435757a26d7cea64ab4976197bb3ac5 100644 --- a/src/pages/User/Register.js +++ b/src/pages/User/Register.js @@ -40,7 +40,7 @@ export default class Register extends Component { if (register.status === 'ok') { dispatch( routerRedux.push({ - pathname: '/user/register-result', + pathname: '/User/RegisterResult', state: { account, }, @@ -279,7 +279,7 @@ export default class Register extends Component { > 注册 - + 使用已有账户登录 diff --git a/src/pages/User/_layout.js b/src/pages/User/_layout.js new file mode 100644 index 0000000000000000000000000000000000000000..ab782db6fa17852fee302dda890d5aa6388d1409 --- /dev/null +++ b/src/pages/User/_layout.js @@ -0,0 +1,15 @@ +import React from 'react'; +import { getRouterData } from 'common/router'; +import { getMenuData } from 'common/menu'; +import UserLayout from '../../layouts/UserLayout'; + +export default props => { + const { children, location } = props; + const routerData = getRouterData({}); + const menuData = getMenuData({}); + return ( + + {children} + + ); +};