CaIon 2 년 전
부모
커밋
87160ec35c
1개의 변경된 파일1개의 추가작업 그리고 8개의 파일을 삭제
  1. 1 8
      middleware/distributor.go

+ 1 - 8
middleware/distributor.go

@@ -46,14 +46,7 @@ func Distribute() func(c *gin.Context) {
 				if modelRequest.Model == "" {
 					modelRequest.Model = "midjourney"
 				}
-			} else {
-				err := common.UnmarshalBodyReusable(c, &modelRequest)
-				if err != nil {
-					abortWithMessage(c, http.StatusBadRequest, "无效的请求")
-					return
-				}
-			}
-			if !strings.HasPrefix(c.Request.URL.Path, "/v1/audio") {
+			} else if !strings.HasPrefix(c.Request.URL.Path, "/v1/audio") {
 				err = common.UnmarshalBodyReusable(c, &modelRequest)
 			}
 			if err != nil {