feat: 项目优化,丛商对接完成

This commit is contained in:
Ben
2025-05-16 18:37:15 +08:00
parent 432ca043c0
commit 26c10f3bc6
66 changed files with 414 additions and 192 deletions

View File

@@ -9,16 +9,21 @@ interface SettingProps {
const Setting: React.FC<SettingProps> = ({ className }) => {
const [email, setEmail] = useState<string>('');
const [key, setKey] = useState<string>('');
const [congShangId, setCongShangId] = useState<string>('');
useEffect(() => {
const savedEmail = localStorage.getItem('userEmail');
const savedKey = localStorage.getItem('userKey');
const savedCongShangId = localStorage.getItem('congShangId');
if (savedEmail) {
setEmail(savedEmail);
}
if (savedKey) {
setKey(savedKey);
}
if (savedCongShangId) {
setCongShangId(savedCongShangId);
}
}, []);
const handleEmailChange = (e: React.ChangeEvent<HTMLInputElement>) => {
@@ -33,6 +38,12 @@ const Setting: React.FC<SettingProps> = ({ className }) => {
localStorage.setItem('userKey', value);
};
const handleChangeCongShangId = (e: React.ChangeEvent<HTMLInputElement>) => {
const value = e.target.value;
setCongShangId(value);
localStorage.setItem('congShangId', value);
};
return (
<Card
title="设置"
@@ -51,6 +62,12 @@ const Setting: React.FC<SettingProps> = ({ className }) => {
onChange={handleKeyChange}
placeholder="请输入您的Key"
/>
<Input
addonBefore="丛商ID"
value={congShangId}
onChange={handleChangeCongShangId}
placeholder="请输入您的丛商ID"
/>
</Space>
</Card>
);