修复 custom context 判断的BUG

This commit is contained in:
白茶清欢 2025-04-12 22:10:48 +08:00
parent e0d5e9c94b
commit 54a8fa91c7

View File

@ -87,8 +87,9 @@ func RequestHandler(uriCfg UriConfig) gin.HandlerFunc {
inputValue = inputValue.Elem() inputValue = inputValue.Elem()
} }
var firstParam reflect.Value var firstParam reflect.Value
if uriCfg.CtxType == define.CustomContextKey { if uriCfg.CtxType == CustomContextType {
firstParam = reflect.ValueOf(ctx.MustGet(define.CustomContextKey)) customCtx := ctx.MustGet(define.CustomContextKey)
firstParam = reflect.ValueOf(customCtx)
} else { } else {
firstParam = reflect.ValueOf(ctx) firstParam = reflect.ValueOf(ctx)
} }