fix: 调整请求体大小限制配置位置与范围

将全局请求体上限配置移除,改为在需要上传的路由分组中单独配置,适配PDF/照片上传需求,避免默认1MB限制导致413错误
This commit is contained in:
SunYF
2026-09-01 08:32:57 +08:00
parent bb1bb2c3f5
commit 31f3d94be1
4 changed files with 17 additions and 2 deletions
-1
View File
@@ -167,7 +167,6 @@ func main() {
server := rest.MustNewServer(
c.RestConf,
rest.WithCors("*"),
rest.WithMaxBytes(c.Upload.MaxMB<<20), // 请求体上限跟随 Upload.MaxMB(默认20MB),否则 go-zero 默认 1MB 会 413
rest.WithNotFoundHandler(http.HandlerFunc(spaHandler.ServeHTTP)),
)
defer server.Stop()