feat: 调整注册逻辑

This commit is contained in:
zdl
2025-10-14 16:02:33 +08:00
parent cd50d718fe
commit e0ca328e1c
12 changed files with 1570 additions and 1206 deletions

View File

@@ -3,6 +3,7 @@ import React from 'react';
import { Routes, Route, Navigate } from 'react-router-dom';
import { Box } from '@chakra-ui/react';
import { useAuth } from '../contexts/AuthContext';
import ErrorBoundary from '../components/ErrorBoundary';
// 导入认证相关页面
import SignInIllustration from '../views/Authentication/SignIn/SignInIllustration';
@@ -33,32 +34,34 @@ const AuthRoute = ({ children }) => {
export default function Auth() {
return (
<Box minH="100vh">
<Routes>
{/* 登录页面 */}
<Route
path="/signin"
element={
<AuthRoute>
<SignInIllustration />
</AuthRoute>
}
/>
{/* 注册页面 */}
<Route
path="/sign-up"
element={
<AuthRoute>
<SignUpIllustration />
</AuthRoute>
}
/>
{/* 默认重定向到登录页 */}
<Route path="/" element={<Navigate to="/auth/signin" replace />} />
<Route path="*" element={<Navigate to="/auth/signin" replace />} />
</Routes>
</Box>
<ErrorBoundary>
<Box minH="100vh">
<Routes>
{/* 登录页面 */}
<Route
path="/signin"
element={
<AuthRoute>
<SignInIllustration />
</AuthRoute>
}
/>
{/* 注册页面 */}
<Route
path="/sign-up"
element={
<AuthRoute>
<SignUpIllustration />
</AuthRoute>
}
/>
{/* 默认重定向到登录页 */}
<Route path="/" element={<Navigate to="/auth/signin" replace />} />
<Route path="*" element={<Navigate to="/auth/signin" replace />} />
</Routes>
</Box>
</ErrorBoundary>
);
}