fix: bill, app detail

This commit is contained in:
archer
2023-07-19 08:36:06 +08:00
parent 58cbf10c85
commit 7a76f54148
12 changed files with 64 additions and 42 deletions

View File

@@ -39,8 +39,12 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
const { kb_ids = [], userChatInput } = req.body as Props;
if (!userChatInput || !Array.isArray(kb_ids)) {
throw new Error('params is error');
if (!userChatInput) {
throw new Error('用户输入为空');
}
if (!Array.isArray(kb_ids) || kb_ids.length === 0) {
throw new Error('没有选择知识库');
}
const result = await kbSearch({

View File

@@ -27,7 +27,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
_id: item._id,
shareId: item.shareId,
name: item.name,
tokens: item.tokens,
total: item.total,
maxContext: item.maxContext,
lastTime: item.lastTime
}))

View File

@@ -188,7 +188,8 @@ export default withNextCors(async function handler(req: NextApiRequest, res: Nex
// bill
finishTaskBill({
billId
billId,
shareId
});
} catch (err: any) {
delTaskBill(billId);