添加系统错误页面

This commit is contained in:
whyour
2022-02-26 00:12:12 +08:00
parent 7dd87220ab
commit eb4976ed6b
8 changed files with 85 additions and 5 deletions
+6
View File
@@ -25,6 +25,12 @@ export default {
hideInMenu: true,
component: '@/pages/initialization/index',
},
{
name: '错误',
path: '/error',
hideInMenu: true,
component: '@/pages/error/index',
},
{
path: '/crontab',
name: '定时任务',
+4 -2
View File
@@ -179,7 +179,9 @@ export default function (props: any) {
};
}, []);
if (['/login', '/initialization'].includes(props.location.pathname)) {
if (
['/login', '/initialization', '/error'].includes(props.location.pathname)
) {
document.title = `${
(config.documentTitleMap as any)[props.location.pathname]
} - 控制面板`;
@@ -190,7 +192,7 @@ export default function (props: any) {
history.push('/crontab');
}
if (systemInfo) {
if (systemInfo || props.location.pathname === '/error') {
return React.Children.map(props.children, (child) => {
return React.cloneElement(child, {
...ctx,