feat: 开发采集、采集箱和商品编辑功能

This commit is contained in:
Joey
2026-08-15 22:17:26 +08:00
parent c61d1a3154
commit 36357843d0
130 changed files with 18005 additions and 12 deletions
+46
View File
@@ -0,0 +1,46 @@
import { useState } from 'react';
import { useNavigate } from 'react-router';
import { Button, Card, Input, message, Typography } from 'antd';
import { login } from '@/services/auth';
import { apiErrorMessage } from '@/services/api';
const { Title, Text } = Typography;
export default function LoginPage() {
const navigate = useNavigate();
const [token, setToken] = useState('');
const [loading, setLoading] = useState(false);
const onSubmit = async () => {
if (!token.trim()) return;
setLoading(true);
try {
await login(token.trim());
message.success('登录成功');
navigate('/collection', { replace: true });
} catch (e) {
message.error(apiErrorMessage(e));
} finally {
setLoading(false);
}
};
return (
<div style={{ minHeight: '100vh', display: 'flex', alignItems: 'center', justifyContent: 'center', background: '#f5f5f5' }}>
<Card style={{ width: 420 }}>
<Title level={3} style={{ marginTop: 0 }}>Ozon </Title>
<Text type="secondary">访 Token .env APP_TOKEN</Text>
<Input.Password
placeholder="APP_TOKEN"
value={token}
onChange={(e) => setToken(e.target.value)}
onPressEnter={onSubmit}
style={{ marginTop: 16 }}
/>
<Button type="primary" block loading={loading} onClick={onSubmit} style={{ marginTop: 16 }}>
</Button>
</Card>
</div>
);
}