import React, { useState } from 'react'; import { BrainCircuit } from 'lucide-react'; import { cn } from '../lib/utils'; interface LoginProps { onLoginSuccess: (token: string) => void; } export function Login({ onLoginSuccess }: LoginProps) { const [username, setUsername] = useState('admin'); const [password, setPassword] = useState('123456'); const [error, setError] = useState(''); const [isLoading, setIsLoading] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setError(''); setIsLoading(true); try { const response = await fetch('/api/login', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ username, password }), }); if (response.ok) { const data = await response.json(); onLoginSuccess(data.token); } else { const errData = await response.json(); setError(errData.error || '登录失败'); } } catch (err) { setError('网络异常,无法连接到后端验证'); } finally { setIsLoading(false); } }; return (
AI 智能切分与多模态数据标注系统
系统受准入受控环境保护。所有流转数据与标注资产将进行端到端加密与访问溯源审计。