feat: add error boundary

This commit is contained in:
GyDi committed 2022-11-19 01:22:19 +08:00
1 parent 166d7ba1cf
commit a1f819a458
5 files changed
+54 -20

No files matched your search

+8 -5
View File
@@ -20,6 +20,7 @@ import LayoutControl from "@/components/layout/layout-control";
import LayoutTraffic from "@/components/layout/layout-traffic";
import UpdateButton from "@/components/layout/update-button";
import useCustomTheme from "@/components/layout/use-custom-theme";
import BaseErrorBoundary from "@/components/base/base-error-boundary";
import getSystem from "@/utils/get-system";
import "dayjs/locale/zh-cn";
@@ -137,11 +138,13 @@ const Layout = () => {
)}
<div className="the-content">
<Routes>
{routers.map(({ label, link, ele: Ele }) => (
<Route key={label} path={link} element={<Ele />} />
))}
</Routes>
<BaseErrorBoundary>
<Routes>
{routers.map(({ label, link, ele: Ele }) => (
<Route key={label} path={link} element={<Ele />} />
))}
</Routes>
</BaseErrorBoundary>
</div>
</div>
</Paper>