中间件里访问不到ctx
- Node Version:
- Egg Version:
- Plugin Name:
- Plugin Version:
- Platform:
第一个参数是 ctx
justinli0709 [email protected]于2017年3月27日 周一11:51写道:
- Node Version:
- Egg Version:
- Plugin Name:
- Plugin Version:
- Platform:
//auth.js module.exports = () => { return async(ctx, next) => { console.log('auth'); console.log(this.ctx); await next(); console.log(this.ctx); }; };
ctx为undefined
请问我应该如何写?多谢!
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/eggjs/egg/issues/658, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWA1XLRSUYI1v64SuZQK65KRea6iU61ks5rpzJdgaJpZM4Mpw4f .
你好,中间件里访问不到ctx,应该怎么写?后来解决了吗?在线等🙈
@xjchenhao 阅读下 https://eggjs.org/zh-cn/basics/objects.html#获取方式-2
@atian25 要升级成Node.js 7.6+才行吗?
看你的 middleware 是哪一种风格,分别有不同的用法,文档那里不是有示例代码么
哦哦 懂了 谢谢🙏