egg
egg copied to clipboard
路由命中多个app.router.get对应controller间怎样交互
- Node Version:
- Egg Version:
- Plugin Name:
- Plugin Version:
- Platform:
- Mini Showcase Repository:
如果一个请求/test, 命中多个router app.router.get('/*', c1) and app.router.get('/test', c2), 由于controller对应方法没有next参数,无法await next(), 导致c1和c2之间无法交互。请问是这样的么
Translation of this issue:
Route Hit Multiple App.Router.get Correspondences Between Controllers
- Node Version:
- Egg Version:
- Plugin Name:
- Plugin Version:
- Platform:
- Mini Showcase Repository:
If a request /test hits more than one router app.router.get('/*', c1) and app.router.get('/test', c2), since the controller corresponding method does not have a next parameter, it cannot await next ( ), resulting in no interaction between c1 and c2. Is this the case?
Yes, only one route will be matched, You need write a middleware.