perf: bill

This commit is contained in:
archer
2023-07-17 13:35:30 +08:00
parent f546068354
commit 60a9dfb55f
10 changed files with 129 additions and 56 deletions

View File

@@ -83,20 +83,10 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
async (data: UserUpdateParams) => {
setLoading(true);
try {
if (data.openaiKey) {
const text = await authOpenAiKey(data.openaiKey);
text &&
toast({
title: text,
status: 'warning'
});
}
await putUserInfo({
openaiKey: data.openaiKey,
avatar: data.avatar
});
updateUserInfo({
openaiKey: data.openaiKey,
avatar: data.avatar
});
reset(data);
@@ -193,25 +183,7 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
</Button>
</Flex>
<Box fontSize={'xs'} color={'blackAlpha.500'}>
openai openai
</Box>
</Box>
<Flex mt={6} alignItems={'center'}>
<Box flex={'0 0 85px'}>openaiKey:</Box>
<Input
{...register(`openaiKey`)}
maxW={'350px'}
placeholder={'openai账号。回车或失去焦点保存'}
size={'sm'}
onBlur={handleSubmit(onclickSave)}
onKeyDown={(e) => {
if (e.keyCode === 13) {
handleSubmit(onclickSave)();
}
}}
></Input>
</Flex>
</Card>
<Card px={6} py={4}>
<Box fontSize={'xl'} fontWeight={'bold'}>
@@ -220,7 +192,6 @@ const NumberSetting = ({ tableType }: { tableType: `${TableEnum}` }) => {
{[
{ label: '佣金比例', value: `${userInfo?.promotion.rate || 15}%` },
{ label: '已注册用户数', value: `${invitedAmount}` },
{ label: '累计佣金', value: `${historyAmount}` },
{ label: '可用佣金', value: `${residueAmount}` }
].map((item) => (
<Flex key={item.label} alignItems={'center'} mt={4} justifyContent={'space-between'}>