perf: api调用和余额校验

This commit is contained in:
archer
2023-03-31 11:20:45 +08:00
parent ed1f93d836
commit 56dab7abba
10 changed files with 104 additions and 62 deletions

View File

@@ -45,6 +45,10 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}
});
if (splitText) {
textList.push(splitText);
}
// 批量插入数据
await SplitData.create({
userId,
@@ -55,9 +59,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
generateQA();
jsonRes(res, {
data: { chunks, replaceText }
});
jsonRes(res);
} catch (err) {
jsonRes(res, {
code: 500,