change this
to ctx
in v2 signature example
This commit is contained in:
parent
bbfa6777a0
commit
a03a7b3059
1 changed files with 1 additions and 1 deletions
|
@ -36,7 +36,7 @@ app.use(async (ctx, next) => {
|
|||
})
|
||||
|
||||
app.use(async ctx => {
|
||||
const user = await User.getById(this.session.userid) // await instead of yield
|
||||
const user = await User.getById(ctx.session.userid) // await instead of yield
|
||||
ctx.body = user // ctx instead of this
|
||||
})
|
||||
```
|
||||
|
|
Loading…
Reference in a new issue