parse token

This commit is contained in:
Gordon
2023-03-15 16:37:09 +08:00
parent becd3eb8f1
commit b8ef0b3513
5 changed files with 69 additions and 5 deletions
+2 -2
View File
@@ -16,13 +16,13 @@ func Call[A, B, C any](
) {
var req A
if err := c.BindJSON(&req); err != nil {
log.ZWarn(c, "gin bind json error", err, req)
log.ZWarn(c, "gin bind json error", err, "req", req)
apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数错误
return
}
if check, ok := any(&req).(interface{ Check() error }); ok {
if err := check.Check(); err != nil {
log.ZWarn(c, "custom check error", err, req)
log.ZWarn(c, "custom check error", err, "req", req)
apiresp.GinError(c, errs.ErrArgs.Wrap(err.Error())) // 参数校验失败
return
}