import { useState } from 'react'; import { Card, Form, Input, Button, Typography, Space, Alert } from 'antd'; import { UserOutlined, LockOutlined, GithubOutlined, SendOutlined, WechatOutlined, CloudSyncOutlined, SearchOutlined, ShareAltOutlined, ApartmentOutlined } from '@ant-design/icons'; import { useAuth } from '../contexts/AuthContext'; import { useSystemStatus } from '../contexts/SystemContext'; import { useNavigate } from 'react-router'; const { Title, Text } = Typography; export default function LoginPage() { const status = useSystemStatus(); const { login } = useAuth(); const [username, setUsername] = useState(''); const [password, setPassword] = useState(''); const [err, setErr] = useState(''); const [loading, setLoading] = useState(false); const navigate = useNavigate(); const handleSubmit = async () => { const u = username.trim(); const p = password; if (!u || !p) { setErr('请输入用户名与密码'); return; } console.debug('[LoginPage] submit ->', { username: u, passwordLength: p.length }); setErr(''); setLoading(true); try { await login(u, p); navigate('/'); } catch (e: any) { console.error('[LoginPage] login failed:', e); setErr(e.message || '登录失败'); } finally { setLoading(false); } }; return (
Foxel Logo 欢迎回来
登录到您的 Foxel 账户
{err && }
} placeholder="用户名/邮箱" value={username} onChange={e => setUsername(e.target.value)} required /> } placeholder="密码" value={password} onChange={e => setPassword(e.target.value)} required />
您的下一代文件管理系统 Foxel 旨在提供一个安全、高效且智能的文件管理解决方案,帮助您轻松组织、访问和共享您的数字资产。
跨平台同步,随时随地访问 AI 驱动的智能搜索,快速定位文件 灵活的分享与协作,提升团队效率 强大的自动化工作流,简化繁琐任务
加入我们的社区:
); }