feat: 完成个人设置界面

This commit is contained in:
Apple\Apple 2024-03-16 10:48:07 +08:00
parent 8d8792a283
commit 27b75d79b8

View File

@ -47,7 +47,7 @@ const PersonalSetting = () => {
const [countdown, setCountdown] = useState(30);
const [affLink, setAffLink] = useState('');
const [systemToken, setSystemToken] = useState('');
const [models, setModels] = useState([]);
// const [models, setModels] = useState([]);
const [openTransfer, setOpenTransfer] = useState(false);
const [transferAmount, setTransferAmount] = useState(0);
@ -72,7 +72,7 @@ const PersonalSetting = () => {
console.log(userState);
}
);
loadModels().then();
// loadModels().then();
getAffLink().then();
setTransferAmount(getQuotaPerUnit());
}, []);
@ -127,16 +127,16 @@ const PersonalSetting = () => {
}
};
const loadModels = async () => {
let res = await API.get(`/api/user/models`);
const { success, message, data } = res.data;
if (success) {
setModels(data);
console.log(data);
} else {
showError(message);
}
};
// const loadModels = async () => {
// let res = await API.get(`/api/user/models`);
// const { success, message, data } = res.data;
// if (success) {
// setModels(data);
// console.log(data);
// } else {
// showError(message);
// }
// };
const handleAffLinkClick = async (e) => {
e.target.select();
@ -343,7 +343,8 @@ const PersonalSetting = () => {
</Descriptions>
}
>
<Typography.Title heading={6}>可用模型</Typography.Title>
<Typography.Title heading={6}>调用信息</Typography.Title>
{/* <Typography.Title heading={6}></Typography.Title>
<div style={{ marginTop: 10 }}>
<Space wrap>
{models.map((model) => (
@ -354,10 +355,9 @@ const PersonalSetting = () => {
</Tag>
))}
</Space>
</div>
</div> */}
</Card>
<Card
{/* <Card
footer={
<div>
<Typography.Text>邀请链接</Typography.Text>
@ -387,6 +387,15 @@ const PersonalSetting = () => {
<Descriptions.Item itemKey="邀请人数">{userState?.user?.aff_count}</Descriptions.Item>
</Descriptions>
</div>
</Card> */}
<Card>
<Typography.Title heading={6}>邀请链接</Typography.Title>
<Input
style={{ marginTop: 10 }}
value={affLink}
onClick={handleAffLinkClick}
readOnly
/>
</Card>
<Card>
<Typography.Title heading={6}>个人信息</Typography.Title>
@ -450,7 +459,7 @@ const PersonalSetting = () => {
</div>
</div>
<div style={{ marginTop: 10 }}>
{/* <div style={{ marginTop: 10 }}>
<Typography.Text strong>Telegram</Typography.Text>
<div style={{ display: 'flex', justifyContent: 'space-between' }}>
<div>
@ -468,7 +477,7 @@ const PersonalSetting = () => {
}
</div>
</div>
</div>
</div> */}
<div style={{ marginTop: 10 }}>
<Space>