fix: add 404 page (#228)

Signed-off-by: sh1luo <690898835@qq.com>
This commit is contained in:
sh1luo
2021-08-06 18:03:05 +08:00
committed by Yang Luo
parent c0ab24205d
commit ca9fcf7edc
2 changed files with 29 additions and 23 deletions

View File

@ -17,7 +17,7 @@ import './App.less';
import {Helmet} from "react-helmet";
import * as Setting from "./Setting";
import {DownOutlined, LogoutOutlined, SettingOutlined} from '@ant-design/icons';
import {Avatar, BackTop, Dropdown, Layout, Menu, Card} from 'antd';
import {Avatar, BackTop, Dropdown, Layout, Menu, Card, Result, Button} from 'antd';
import {Link, Redirect, Route, Switch, withRouter} from 'react-router-dom'
import OrganizationListPage from "./OrganizationListPage";
import OrganizationEditPage from "./OrganizationEditPage";
@ -34,7 +34,7 @@ import TokenEditPage from "./TokenEditPage";
import RecordListPage from "./RecordListPage";
import AccountPage from "./account/AccountPage";
import HomePage from "./basic/HomePage";
import CustomGithubCorner from "./CustomGithubCorner";
// import CustomGithubCorner from "./CustomGithubCorner";
import * as Auth from "./auth/Auth";
import SignupPage from "./auth/SignupPage";
@ -389,6 +389,8 @@ class App extends Component {
<Route exact path="/tokens" render={(props) => this.renderLoginIfNotLoggedIn(<TokenListPage account={this.state.account} {...props} />)}/>
<Route exact path="/tokens/:tokenName" render={(props) => this.renderLoginIfNotLoggedIn(<TokenEditPage account={this.state.account} {...props} />)}/>
<Route exact path="/records" render={(props) => this.renderLoginIfNotLoggedIn(<RecordListPage account={this.state.account} {...props} />)}/>
<Route path="" render={() => <Result status="404" title="404 NOT FOUND" subTitle={i18next.t("general:Sorry, the page you visited does not exist.")}
extra={<a href="/"><Button type="primary">{i18next.t("general:Back Home")}</Button></a>} />} />
</Switch>
</div>
)
@ -510,6 +512,8 @@ class App extends Component {
<Route exact path="/forget/:applicationName" render={(props) => this.renderHomeIfLoggedIn(<ForgetPage {...props} />)}/>
<Route exact path="/prompt" render={(props) => this.renderLoginIfNotLoggedIn(<PromptPage account={this.state.account} {...props} />)}/>
<Route exact path="/prompt/:applicationName" render={(props) => this.renderLoginIfNotLoggedIn(<PromptPage account={this.state.account} onUpdateAccount={(account) => {this.onUpdateAccount(account)}} {...props} />)}/>
<Route path="" render={() => <Result status="404" title="404 NOT FOUND" subTitle={i18next.t("general:Sorry, the page you visited does not exist.")}
extra={<a href="/"><Button type="primary">{i18next.t("general:Back Home")}</Button></a>}/>} />
</Switch>
)
}

View File

@ -80,7 +80,9 @@
"Signin URL": "Signin URL",
"Signin URL - Tooltip": "sign in url",
"ID - Tooltip": "random string",
"Favicon - Tooltip": "Application icon"
"Favicon - Tooltip": "Application icon",
"Back Home": "Back Home",
"Sorry, the page you visited does not exist": "Sorry, the page you visited does not exist"
},
"signup":
{