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
中间件怎么给后面的controller传值? #742
Labels
Comments
直接赋值给 可以参考下 |
@atian25 thx |
这种最好放在 state 里面吧。 我记得 koa 也是这么推荐的。 ctx.state.token = ''; |
egg 里面 state 有个别名叫 locals, 推荐用后者。
发自我的 iPhone
… 在 2017年4月12日,23:47,larry ***@***.***> 写道:
这种最好放在 state 里面吧。 我记得 koa 也是这么推荐的。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
但 user 这个比较通用,故特意独立出来,不用放到 local 去
发自我的 iPhone
… 在 2017年4月12日,23:47,larry ***@***.***> 写道:
这种最好放在 state 里面吧。 我记得 koa 也是这么推荐的。
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
我想问下,我用jwt验证,在中间间的时候解析了token,然后怎么把解析后的信息传给后面的controller用的呢?我试过this.request.api_user=user或者this.locals.api_user=user都不行啊,求教
The text was updated successfully, but these errors were encountered: