import React, { useState } from 'react'; import { Form, Input, Button, Checkbox, Tabs, message } from 'antd'; import { UserOutlined, LockOutlined, EyeInvisibleOutlined, EyeTwoTone, HomeOutlined } from '@ant-design/icons'; import { history, useIntl } from 'umi'; import './login.less'; const { TabPane } = Tabs; const LoginPage: React.FC = () => { const [activeKey, setActiveKey] = useState('supplier'); const [form] = Form.useForm(); const [loading, setLoading] = useState(false); const intl = useIntl(); const onFinish = (values: any) => { setLoading(true); console.log('登录信息:', values); // 这里添加登录逻辑 setTimeout(() => { setLoading(false); message.success('登录成功'); history.push('/index'); }, 1000); }; const handleTabChange = (key: string) => { setActiveKey(key); form.resetFields(); }; // 根据当前选中的Tab决定跳转到哪个注册页面 const handleRegister = () => { switch(activeKey) { case 'supplier': history.push('/register/supplier'); break; case 'expert': history.push('/register/expert'); break; default: // 招标代理不提供注册功能 break; } }; // 渲染注册链接(只在供应商和专家Tab下显示) const renderRegisterLink = () => { if (activeKey === 'agent') { return null; // 招标代理不显示注册链接 } return (