Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Middleware resolve 函数支持参数传入(路由中间件场景 #2572

Open
TimonPeng opened this issue Dec 9, 2022 · 2 comments
Open
Labels
type: enhancement New feature or request

Comments

@TimonPeng
Copy link

TimonPeng commented Dec 9, 2022

@Get('/admin', { middleware: [ AuthMiddleware('admin') ]})

resolve(role: 'user' | 'admin'),或者函数中间件支持 Inject 也可以(可以包一层函数返回)?

否则只能在内部根据路由匹配策略了。

@czy88840616
Copy link
Member

类中间件目前不支持传参,resolve 的参数已经有了,所以应该没法加在这个地方。

@czy88840616 czy88840616 added the type: enhancement New feature or request label Dec 11, 2022
@yxmg
Copy link

yxmg commented Nov 17, 2023

同样的问题,现在支持了吗?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Development

No branches or pull requests

3 participants