Skip to content

Commit

Permalink
feat(portal): 增加404页面
Browse files Browse the repository at this point in the history
  • Loading branch information
moonrailgun committed May 9, 2020
1 parent ac7abb1 commit e5762bb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/portal/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from 'react';
import { Router, Switch, Route, RouteProps } from 'react-router';

import { postMessage } from '@portal/utils/event';
import history from './history';
import { routes } from './routes';
import NotFound from './routes/404';

interface TitleRouteProps extends RouteProps {
title: string;
Expand Down Expand Up @@ -38,6 +38,7 @@ class App extends React.Component {
{routes.map((config) => (
<TitleRoute key={config.path} {...config} />
))}
<Route component={NotFound} />
</Switch>
</Router>
);
Expand Down
13 changes: 13 additions & 0 deletions src/portal/routes/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React from 'react';
import { TMemo } from '@shared/components/TMemo';

const NotFound: React.FC = TMemo(() => {
return (
<div>
<h2 style={{textAlign: 'center'}}>页面没找到</h2>
</div>
);
});
NotFound.displayName = 'NotFound';

export default NotFound;

0 comments on commit e5762bb

Please sign in to comment.