Przeglądaj źródła

Update distributor.go

luxl 2 lat temu
rodzic
commit
f784f232c2
1 zmienionych plików z 2 dodań i 1 usunięć
  1. 2 1
      middleware/distributor.go

+ 2 - 1
middleware/distributor.go

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