feat: 账单模块

This commit is contained in:
archer
2023-03-21 18:04:39 +08:00
parent 42c26bd155
commit 129f3a2a30
11 changed files with 190 additions and 37 deletions

View File

@@ -85,7 +85,7 @@ const SlideBar = ({
: {})}
onClick={() => {
if (item.chatId === chatId) return;
router.push(`/chat?chatId=${item.chatId}`);
router.replace(`/chat?chatId=${item.chatId}`);
onClose();
}}
>
@@ -187,7 +187,7 @@ const SlideBar = ({
: {})}
onClick={async () => {
if (item.name === name) return;
router.push(`/chat?chatId=${await getChatSiteId(item._id)}`);
router.replace(`/chat?chatId=${await getChatSiteId(item._id)}`);
onClose();
}}
>

View File

@@ -152,7 +152,7 @@ const Chat = ({ chatId }: { chatId: string }) => {
const resetChat = useCallback(async () => {
if (!chatData) return;
try {
router.push(`/chat?chatId=${await getChatSiteId(chatData.modelId)}`);
router.replace(`/chat?chatId=${await getChatSiteId(chatData.modelId)}`);
} catch (error: any) {
toast({
title: error?.message || '生成新对话失败',