修复 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()
}
var firstParam reflect.Value
if uriCfg.CtxType == define.CustomContextKey {
firstParam = reflect.ValueOf(ctx.MustGet(define.CustomContextKey))
if uriCfg.CtxType == CustomContextType {
customCtx := ctx.MustGet(define.CustomContextKey)
firstParam = reflect.ValueOf(customCtx)
} else {
firstParam = reflect.ValueOf(ctx)
}