生产管理系统 404页面兜底
This commit is contained in:
@@ -30,7 +30,7 @@ import { useAuth } from '@/components/auth/AuthContext';
|
||||
import { authReducer, initialAuthState, AuthState, AuthAction } from './authReducer';
|
||||
import { getCaptchaApiV1AuthCaptchaGet, loginApiV1AuthLoginPost } from '@/lib/api/sdk.gen';
|
||||
import type { CaptchaResponse } from '@/lib/api/types.gen';
|
||||
|
||||
import {PERSONAL_CELTRAL_PAGE} from "@/config/constants"
|
||||
interface LoginFormProps {
|
||||
onRegisterClick: () => void;
|
||||
}
|
||||
@@ -150,7 +150,7 @@ export function LoginForm({ onRegisterClick }: LoginFormProps) {
|
||||
login(userData);
|
||||
toast.success('登录成功!正在跳转...');
|
||||
// 跳转到个人中心页面
|
||||
window.location.href = '/central-config/personal-center/personal-info';
|
||||
window.location.href = PERSONAL_CELTRAL_PAGE;
|
||||
} else {
|
||||
dispatch({ type: 'SET_ERROR', payload: '登录失败,请检查用户名和密码' });
|
||||
toast.error('登录失败,请检查用户名和密码');
|
||||
@@ -279,6 +279,7 @@ export function LoginForm({ onRegisterClick }: LoginFormProps) {
|
||||
value={state.passwordForm.captcha}
|
||||
onChange={(value) => dispatch({ type: 'UPDATE_PASSWORD_FORM', payload: { captcha: value } })}
|
||||
onCaptchaChange={(captchaData) => setPasswordCaptchaData(captchaData)}
|
||||
instanceId="password-login"
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
@@ -357,6 +358,7 @@ export function LoginForm({ onRegisterClick }: LoginFormProps) {
|
||||
<CaptchaInput
|
||||
value={state.phoneForm.captcha}
|
||||
onChange={(value) => dispatch({ type: 'UPDATE_PHONE_FORM', payload: { captcha: value } })}
|
||||
instanceId="phone-login"
|
||||
className="mt-2"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -17,13 +17,9 @@ export default function NotFound() {
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen relative flex items-center justify-center">
|
||||
|
||||
{/* 主要内容 */}
|
||||
<div className="relative z-10 w-full max-w-2xl mx-auto p-6">
|
||||
{/* 404 状态卡片 */}
|
||||
<Card className="backdrop-blur-md bg-background/80 border-border/50 shadow-2xl">
|
||||
<CardHeader className="text-center pb-2">
|
||||
<Card className="backdrop-blur-md absolute inset-x-6 top-6 bottom-6
|
||||
flex-1 min-h-0">
|
||||
<CardHeader className="text-center p-0">
|
||||
<div className="flex justify-center mb-4">
|
||||
<div className="relative">
|
||||
<div className="text-8xl font-bold text-destructive animate-pulse">404</div>
|
||||
@@ -43,7 +39,7 @@ export default function NotFound() {
|
||||
</CardDescription>
|
||||
</CardHeader>
|
||||
|
||||
<CardContent className="space-y-6">
|
||||
<CardContent className="space-y-6 p-0">
|
||||
{/* 错误信息提示 */}
|
||||
<Alert>
|
||||
<Search className="h-4 w-4" />
|
||||
@@ -100,7 +96,7 @@ export default function NotFound() {
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
<CardFooter className="flex flex-col space-y-4 pt-6 border-t">
|
||||
<CardFooter className="flex flex-col space-y-4 pt-6 border-t p-0">
|
||||
{/* 帮助信息 */}
|
||||
<div className="text-center text-sm text-muted-foreground">
|
||||
<p>需要帮助?请联系系统管理员</p>
|
||||
@@ -113,7 +109,5 @@ export default function NotFound() {
|
||||
</div>
|
||||
</CardFooter>
|
||||
</Card>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -52,11 +52,6 @@ export function ClientAuthInterceptor({ children }: ClientAuthInterceptorProps)
|
||||
return <>{children}</>;
|
||||
}
|
||||
|
||||
// 如果未认证且不在认证页面,显示跳转状态
|
||||
if (!isAuthenticated) {
|
||||
return <LoadingScreen variant="redirect" />;
|
||||
}
|
||||
|
||||
// 认证通过,渲染子组件
|
||||
return <>{children}</>;
|
||||
}
|
||||
@@ -63,7 +63,7 @@ export function MainContent({
|
||||
|
||||
return (
|
||||
<div className="flex-1 flex flex-col bg-background h-full">
|
||||
<div className="flex-1 p-6 min-h-0 content-container">
|
||||
<div className="flex-1 p-6 min-h-0 content-container relative">
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -54,4 +54,7 @@ export const THEME = {
|
||||
warning: '#f59e0b',
|
||||
error: '#ef4444'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 默认有权限的首页 个人中心
|
||||
export const PERSONAL_CELTRAL_PAGE = "central-config/personal-center/personal-info"
|
||||
Reference in New Issue
Block a user