feat: share窗口

This commit is contained in:
archer
2023-03-21 23:47:26 +08:00
parent d065539707
commit 984baf60f0
11 changed files with 33 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ import { pushBill } from '@/service/events/bill';
export default async function handler(req: NextApiRequest, res: NextApiResponse) {
try {
const { prompt, chatId } = req.body as { prompt: ChatItemType[]; chatId: string };
const { authorization } = req.headers;
if (!prompt || !chatId) {
throw new Error('缺少参数');
@@ -19,7 +20,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
await connectToDatabase();
const { chat, userApiKey, systemKey, userId } = await authChat(chatId);
const { chat, userApiKey, systemKey, userId } = await authChat(chatId, authorization);
const model = chat.modelId;