ソースを参照

Update distributor.go

luxl 2 年 前
コミット
f784f232c2
1 ファイル変更2 行追加1 行削除
  1. 2 1
      middleware/distributor.go

+ 2 - 1
middleware/distributor.go

@@ -46,8 +46,9 @@ func Distribute() func(c *gin.Context) {
 				if modelRequest.Model == "" {
 				if modelRequest.Model == "" {
 					modelRequest.Model = "midjourney"
 					modelRequest.Model = "midjourney"
 				}
 				}
+			} else {
+				err = common.UnmarshalBodyReusable(c, &modelRequest)
 			}
 			}
-			err = common.UnmarshalBodyReusable(c, &modelRequest)
 			if err != nil {
 			if err != nil {
 				abortWithMessage(c, http.StatusBadRequest, "无效的请求")
 				abortWithMessage(c, http.StatusBadRequest, "无效的请求")
 				return
 				return