我想如何将中间件应用于 koa-route 中的所有路径,例如
router1.use( (ctx) => {
console.error("hello 0 ...");
console.log(ctx.url);
}
router1.all( (ctx) => {
console.error("hello 0 ...");
console.log(ctx.url);
}
它像这样返回路径 += str.slice(index, offset) ^
TypeError: str.slice is not a function 有什么提示吗?谢谢!