mirror of
https://github.com/yangjian102621/geekai.git
synced 2025-12-07 16:56:30 +08:00
限制绘画提示词长度,修复移动端角色和模型绑定失败问题
This commit is contained in:
@@ -56,6 +56,15 @@ func (h *VideoHandler) LumaCreate(c *gin.Context) {
|
||||
resp.ERROR(c, types.InvalidArgs)
|
||||
return
|
||||
}
|
||||
// 检查 Prompt 长度
|
||||
if data.Prompt == "" {
|
||||
resp.ERROR(c, "prompt is needed")
|
||||
return
|
||||
}
|
||||
if len(data.Prompt) > 2000 {
|
||||
resp.ERROR(c, "提示词太长,请删减提示词。")
|
||||
return
|
||||
}
|
||||
|
||||
user, err := h.GetLoginUser(c)
|
||||
if err != nil {
|
||||
@@ -68,11 +77,6 @@ func (h *VideoHandler) LumaCreate(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
|
||||
if data.Prompt == "" {
|
||||
resp.ERROR(c, "prompt is needed")
|
||||
return
|
||||
}
|
||||
|
||||
userId := int(h.GetLoginUserId(c))
|
||||
params := types.LumaVideoParams{
|
||||
PromptOptimize: data.ExpandPrompt,
|
||||
@@ -156,6 +160,10 @@ func (h *VideoHandler) KeLingCreate(c *gin.Context) {
|
||||
resp.ERROR(c, "prompt is needed")
|
||||
return
|
||||
}
|
||||
if len(data.Prompt) > 2000 {
|
||||
resp.ERROR(c, "提示词太长,请删减提示词。")
|
||||
return
|
||||
}
|
||||
|
||||
userId := int(h.GetLoginUserId(c))
|
||||
params := types.KeLingVideoParams{
|
||||
|
||||
Reference in New Issue
Block a user