Let's use AI to Earn!
TypeScript auto-publishdouyindouyin-apielectron-appelectron-reactkuaishoukwaipublishedshipinhaotoolxiaohongshu
feat: 捕获错误展示错误代码
gaoSir0b816de40f6d
diff --git a/src/components/ErrorBoundary/ErrorBoundary.tsx b/src/components/ErrorBoundary/ErrorBoundary.tsxindex cf155f31..cc1f5cbf 100644--- a/src/components/ErrorBoundary/ErrorBoundary.tsx+++ b/src/components/ErrorBoundary/ErrorBoundary.tsx@@ -33,6 +33,7 @@ const ErrorBoundary: React.FC<ErrorBoundaryProps> = ({ children }) => {// 您可以自定义回退UIreturn (<div className={styles.errorBoundary}>+ <code>{errorMsg}</code><h1>对不起,系统出现了错误</h1><Buttontype="primary"diff --git a/src/components/ErrorBoundary/errorBoundary.module.scss b/src/components/ErrorBoundary/errorBoundary.module.scssindex bf90f23a..49ea0b83 100644--- a/src/components/ErrorBoundary/errorBoundary.module.scss+++ b/src/components/ErrorBoundary/errorBoundary.module.scss@@ -5,6 +5,10 @@align-items: center;justify-content: center;flex-direction: column;+ code {+ font-size: var(--fs-md);+ margin-bottom: 50px;+ }&:after {content: "";display: block;diff --git a/src/router/index.tsx b/src/router/index.tsxindex c02427ec..2685cb94 100644--- a/src/router/index.tsx+++ b/src/router/index.tsx@@ -28,7 +28,6 @@ import { LayoutBody } from '@/layout/LayoutBody';// 页面组件import Login from '@/views/login';import Trending from '@/views/trending';-// import About from '@/views/about/About';import Account from '@/views/account';import Publish from '@/views/publish/page';import VideoPage from '@/views/publish/children/videoPage/page';@@ -97,14 +96,6 @@ export const router: CustomRouteObject[] = [element: <Trending />,meta: { name: '热门内容', icon: FireOutlined },},- // {- // path: '/about',- // element: <About />,- // meta: {- // name: '关于',- // icon: InfoCircleOutlined,- // },- // },{path: '/publish',element: <Publish />,diff --git a/src/views/about/About.tsx b/src/views/about/About.tsxdeleted file mode 100644index cee96536..00000000--- a/src/views/about/About.tsx+++ /dev/null@@ -1,21 +0,0 @@-/*- * @Author: nevin- * @Date: 2025-01-17 20:05:00- * @LastEditTime: 2025-01-20 21:59:19- * @LastEditors: nevin- * @Description: 关于- */-import './about.css';--const About = () => {- return (- <div className="page-container">- <div className="content-wrapper">- <h1 className="mb-4 text-2xl font-bold">关于我们</h1>- {/* 其他内容 */}- </div>- </div>- );-};--export default About;diff --git a/src/views/about/about.css b/src/views/about/about.cssdeleted file mode 100644index 1809188b..00000000--- a/src/views/about/about.css+++ /dev/null@@ -1,51 +0,0 @@-#root {- margin: 0 auto;- padding: 2rem;- text-align: center;-}--.logo-box {- position: relative;- height: 9em;-}--.logo {- position: absolute;- left: calc(50% - 4.5em);- height: 6em;- padding: 1.5em;- will-change: filter;- transition: filter 300ms;-}-.logo:hover {- filter: drop-shadow(0 0 2em #646cffaa);-}--@keyframes logo-spin {- from {- transform: rotate(0deg);- }- to {- transform: rotate(360deg);- }-}--@media (prefers-reduced-motion: no-preference) {- .logo.electron {- animation: logo-spin infinite 20s linear;- }-}--.card {- padding: 2em;-}--.read-the-docs {- color: #888;-}--.flex-center {- display: flex;- align-items: center;- justify-content: center;-}diff --git a/src/views/publish/children/videoPage/page.tsx b/src/views/publish/children/videoPage/page.tsxindex 0851da35..1ccdc8cc 100644--- a/src/views/publish/children/videoPage/page.tsx+++ b/src/views/publish/children/videoPage/page.tsx@@ -64,7 +64,6 @@ export default function Page() {<div className={styles.video}><Spin spinning={loadingPageLoading}><VideoPubSetModal onClose={setVideoPubSetModalOpen} />-<ChooseAccountModuledisableAllSelect={accountChooseType.current === AccountChooseType.Radio ||