添加模型查询接口只需要查询启用模型

This commit is contained in:
小帅 2026-04-07 00:32:13 +08:00
parent 11e07a3272
commit fdab2c00ff
2 changed files with 1 additions and 2 deletions

View File

@ -13,7 +13,7 @@ export default router.post(
async (req, res) => { async (req, res) => {
const { modelId } = req.body; const { modelId } = req.body;
const [id, name] = modelId.split(":"); const [id, name] = modelId.split(":");
const data = await u.db("o_vendorConfig").where("id", id).select("models").first(); const data = await u.db("o_vendorConfig").where("id", id).andWhere("enable", 1).select("models").first();
if (!data) { if (!data) {
return res.status(404).send({ error: "模型未找到" }); return res.status(404).send({ error: "模型未找到" });
} }

View File

@ -109,7 +109,6 @@ export default router.post(
} }
} }
} }
const [id, modelData] = model.split(":"); const [id, modelData] = model.split(":");
const projectData = await u.db("o_project").select("*").where({ id: projectId }).first(); const projectData = await u.db("o_project").select("*").where({ id: projectId }).first();
const videoPrompt = await u.db("o_prompt").where("type", "videoPromptGeneration").first(); const videoPrompt = await u.db("o_prompt").where("type", "videoPromptGeneration").first();