feat: Support batch fetch, and update AI prompt

This commit is contained in:
Gabe
2025-09-03 00:37:35 +08:00
parent 2bfb27f346
commit d4e58fc925
14 changed files with 576 additions and 244 deletions

View File

@@ -289,3 +289,16 @@ export const parseJsonObj = (str) => {
return {};
};
/**
* 提取json内容
* @param {*} s
* @returns
*/
export const extractJson = (raw) => {
if (!raw) return "{}";
let s = raw.replace(/^\s*```(?:json)?\s*/i, "").replace(/\s*```\s*$/i, "");
const match = s.match(/\{[\s\S]*\}/);
return match ? match[0] : "{}";
};