添加模型查询接口只需要查询启用模型
This commit is contained in:
parent
11e07a3272
commit
fdab2c00ff
@ -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: "模型未找到" });
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user