From dd963f297c1750f7ab57ace4de3c037633bfad6b Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Sun, 14 Dec 2025 08:17:42 +0800 Subject: [PATCH] update pay ui --- src/routes/index.js | 7 +++++-- src/views/Landing/index.js | 22 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 src/views/Landing/index.js diff --git a/src/routes/index.js b/src/routes/index.js index 75dfbda1..10e6817f 100644 --- a/src/routes/index.js +++ b/src/routes/index.js @@ -7,6 +7,9 @@ import { Routes, Route, Navigate } from 'react-router-dom'; // 路由配置 import { getMainLayoutRoutes, getStandaloneRoutes } from './routeConfig'; +// Landing 页面(重定向到静态 landing.html) +import Landing from '@views/Landing'; + // 布局组件 import MainLayout from '@layouts/MainLayout'; @@ -51,8 +54,8 @@ export function AppRoutes() { {/* 独立路由 - 无布局(如登录页)*/} {standaloneRoutes.map(renderRoute)} - {/* 默认路由 - 重定向到首页 */} - } /> + {/* 默认路由 - 显示 Landing 页面(跳转到静态 landing.html) */} + } /> {/* 404 页面 - 捕获所有未匹配的路由 */} } /> diff --git a/src/views/Landing/index.js b/src/views/Landing/index.js new file mode 100644 index 00000000..f616ad4e --- /dev/null +++ b/src/views/Landing/index.js @@ -0,0 +1,22 @@ +// src/views/Landing/index.js +// Landing 页面 - 重定向到静态 landing.html +import { useEffect } from 'react'; + +/** + * Landing 组件 + * + * 作用:将用户从 React SPA 重定向到静态 landing.html 页面 + * + * 为什么使用 window.location.replace: + * - 不会在浏览历史中留下记录(用户点后退不会回到空白页) + * - 直接跳转到静态 HTML,不需要 React 渲染 + */ +export default function Landing() { + useEffect(() => { + // 直接跳转到 landing.html(不留浏览历史) + window.location.replace('/landing.html'); + }, []); + + // 返回 null,因为会立即跳转 + return null; +} \ No newline at end of file