平替ShouldBindJSON
This commit is contained in:
1 parent
14520f404c
commit
fea161f4aa
2 files changed
+3
-3
No files matched your search
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// 读取json请求结构团体
|
||||
func JSONBody(r *http.Request, args any) error {
|
||||
func ShouldBindJSON(r *http.Request, args any) error {
|
||||
body, err := io.ReadAll(io.LimitReader(r.Body, global.RequestBodyMaxLen))
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user