Closed maxushuang closed 7 years ago
in my routers.
const router = require('koa-router')(); router.get('/', async (ctx, next) => { this.session.user={} // types error ,this.session is undefined, ctx.session.user= {} // it's success, })
in my entry's
const Koa = require('koa'); //koa versersion 2.2 const session = require('koa-generic-session'); const app = new Koa(); app.keys=['secret']; app.use(session());
I cannot use this.session, there is something wrong with my use? Can you help me with it? Thank you. 求解答
in my routers.
in my entry's
I cannot use this.session, there is something wrong with my use? Can you help me with it? Thank you. 求解答