Commit 7815eecd authored by afc163's avatar afc163

404 page for /xxx/whatever

parent c0c65a0f
...@@ -8,12 +8,13 @@ import moment from 'moment'; ...@@ -8,12 +8,13 @@ import moment from 'moment';
import groupBy from 'lodash/groupBy'; import groupBy from 'lodash/groupBy';
import { ContainerQuery } from 'react-container-query'; import { ContainerQuery } from 'react-container-query';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './BasicLayout.less';
import HeaderSearch from '../components/HeaderSearch'; import HeaderSearch from '../components/HeaderSearch';
import NoticeIcon from '../components/NoticeIcon'; import NoticeIcon from '../components/NoticeIcon';
import GlobalFooter from '../components/GlobalFooter'; import GlobalFooter from '../components/GlobalFooter';
import { getNavData } from '../common/nav'; import { getNavData } from '../common/nav';
import { getRouteData } from '../utils/utils'; import { getRouteData } from '../utils/utils';
import NotFound from '../routes/Exception/404';
import styles from './BasicLayout.less';
const { Header, Sider, Content } = Layout; const { Header, Sider, Content } = Layout;
const { SubMenu } = Menu; const { SubMenu } = Menu;
...@@ -356,7 +357,8 @@ class BasicLayout extends React.PureComponent { ...@@ -356,7 +357,8 @@ class BasicLayout extends React.PureComponent {
) )
) )
} }
<Redirect to="/dashboard/analysis" /> <Redirect exact from="/" to="/dashboard/analysis" />
<Route component={NotFound} />
</Switch> </Switch>
<GlobalFooter <GlobalFooter
links={[{ links={[{
......
import React from 'react'; import React from 'react';
import { Router, Route, Switch, Redirect } from 'dva/router'; import { Router, Route, Switch } from 'dva/router';
import { LocaleProvider } from 'antd'; import { LocaleProvider } from 'antd';
import zhCN from 'antd/lib/locale-provider/zh_CN'; import zhCN from 'antd/lib/locale-provider/zh_CN';
import BasicLayout from './layouts/BasicLayout'; import BasicLayout from './layouts/BasicLayout';
...@@ -12,7 +12,6 @@ function RouterConfig({ history }) { ...@@ -12,7 +12,6 @@ function RouterConfig({ history }) {
<Switch> <Switch>
<Route path="/user" component={UserLayout} /> <Route path="/user" component={UserLayout} />
<Route path="/" component={BasicLayout} /> <Route path="/" component={BasicLayout} />
<Redirect to="/" />
</Switch> </Switch>
</Router> </Router>
</LocaleProvider> </LocaleProvider>
......
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