We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 53ff12c commit 1c2e4e2Copy full SHA for 1c2e4e2
code/koa/koa-run-sort.js
@@ -9,8 +9,9 @@ app.use(async(ctx, next) => {
9
const middleRes1 = await next()
10
console.log('middleware1===>', middleRes1)
11
const rt = ctx.response.get('X-Response-Time')
12
- const { method, url } = ctx
13
- console.log(`请求信息:${method}-${url} - ${rt}`)
+ const { method } = ctx
+ // 也可以从ctx中获取url对象
14
+ console.log(`请求信息:${method} - ${rt}`)
15
return 'back middleware1 result'
16
})
17
0 commit comments