perf: 参数值

This commit is contained in:
archer
2023-04-21 19:55:56 +08:00
parent 3c0fa30aaf
commit 4f51839026
7 changed files with 114 additions and 27 deletions

View File

@@ -40,6 +40,9 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse<
// 去重
const searchRes = await Promise.allSettled(
data.map(async ([q, a]) => {
if (!q || !a) {
return Promise.reject('q/a为空');
}
try {
q = q.replace(/\\n/g, '\n');
a = a.replace(/\\n/g, '\n');