Commit 57767505 authored by Andreas Cederström's avatar Andreas Cederström Committed by ddcat1115

redirect from /user to /user/login (#632)

parent c036c862
import React from 'react'; import React from 'react';
import { Link, Route } from 'dva/router'; import { Link, Redirect, Switch, Route } from 'dva/router';
import DocumentTitle from 'react-document-title'; import DocumentTitle from 'react-document-title';
import { Icon } from 'antd'; import { Icon } from 'antd';
import GlobalFooter from '../components/GlobalFooter'; import GlobalFooter from '../components/GlobalFooter';
...@@ -47,8 +47,8 @@ class UserLayout extends React.PureComponent { ...@@ -47,8 +47,8 @@ class UserLayout extends React.PureComponent {
</div> </div>
<div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div> <div className={styles.desc}>Ant Design 是西湖区最具影响力的 Web 设计规范</div>
</div> </div>
{ <Switch>
getRoutes(match.path, routerData).map(item => {getRoutes(match.path, routerData).map(item =>
( (
<Route <Route
key={item.key} key={item.key}
...@@ -57,8 +57,9 @@ class UserLayout extends React.PureComponent { ...@@ -57,8 +57,9 @@ class UserLayout extends React.PureComponent {
exact={item.exact} exact={item.exact}
/> />
) )
) )}
} <Redirect exact from="/user" to="/user/login" />
</Switch>
<GlobalFooter className={styles.footer} links={links} copyright={copyright} /> <GlobalFooter className={styles.footer} links={links} copyright={copyright} />
</div> </div>
</DocumentTitle> </DocumentTitle>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment