mirror of
https://github.com/openimsdk/open-im-server.git
synced 2026-05-04 17:15:58 +08:00
parse token
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user