From ca9fcf7edcedd4126e9c3d80c7c6afc46a7e2ad1 Mon Sep 17 00:00:00 2001 From: sh1luo <690898835@qq.com> Date: Fri, 6 Aug 2021 18:03:05 +0800 Subject: [PATCH] fix: add 404 page (#228) Signed-off-by: sh1luo <690898835@qq.com> --- web/src/App.js | 48 +++++++++++++++++++----------------- web/src/locales/en/data.json | 4 ++- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/web/src/App.js b/web/src/App.js index 4b641c4f..4f2371d5 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -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"; @@ -370,26 +370,28 @@ class App extends Component { renderRouter(){ return(
- - this.renderHomeIfLoggedIn()}/> - this.renderHomeIfLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - }/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - this.renderLoginIfNotLoggedIn()}/> - + + this.renderHomeIfLoggedIn()}/> + this.renderHomeIfLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + }/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + this.renderLoginIfNotLoggedIn()}/> + } />} /> +
) } @@ -510,6 +512,8 @@ class App extends Component { this.renderHomeIfLoggedIn()}/> this.renderLoginIfNotLoggedIn()}/> this.renderLoginIfNotLoggedIn( {this.onUpdateAccount(account)}} {...props} />)}/> + }/>} /> ) } diff --git a/web/src/locales/en/data.json b/web/src/locales/en/data.json index 5736e93e..729a9f84 100644 --- a/web/src/locales/en/data.json +++ b/web/src/locales/en/data.json @@ -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": {