import React, { useEffect, useState } from 'react'; import { Row, Col, Typography, Button, Form, Input, Space, Tabs, App } from 'antd'; import { UserOutlined, LockOutlined, ArrowRightOutlined, } from '@ant-design/icons'; import httpService from '../services/httpService'; import { buildApiUrl, API_ENDPOINTS } from '../config/api'; import menuService from '../services/menuService'; import BrandLogo from '../components/BrandLogo'; import configService from '../utils/configService'; const { Title, Paragraph, Text } = Typography; const BRAND_HIGHLIGHTS = [ '智能转录与结构化总结', '时间轴回看与全文检索', '沉淀可追踪的会议资产', ]; const HOME_TAGLINE = '让每一次谈话都产生价值'; const HomePage = ({ onLogin }) => { const [loading, setLoading] = useState(false); const [branding, setBranding] = useState(() => configService.getCachedBrandingConfig()); const { message } = App.useApp(); useEffect(() => { if (branding) { return; } let active = true; configService.getBrandingConfig().then((nextBranding) => { if (active) { setBranding(nextBranding); } }).catch((error) => { console.error('Load branding config failed:', error); }); return () => { active = false; }; }, [branding]); if (!branding) { return null; } const handleLogin = async (values) => { setLoading(true); try { const response = await httpService.post(buildApiUrl(API_ENDPOINTS.AUTH.LOGIN), { username: values.username, password: values.password }); if (response.code === '200') { message.success('登录成功'); menuService.clearCache(); onLogin(response.data); } else { message.error(response.message || '登录失败'); } } catch (error) { console.error('Login error:', error); message.error(error.response?.data?.message || '账号或密码错误'); } finally { setLoading(false); } }; return (