diff --git a/src/content/docs/zh-cn/guides/middleware.mdx b/src/content/docs/zh-cn/guides/middleware.mdx index 2d45bcee62a1f..68a5285a4d249 100644 --- a/src/content/docs/zh-cn/guides/middleware.mdx +++ b/src/content/docs/zh-cn/guides/middleware.mdx @@ -257,7 +257,7 @@ export function onRequest (context, next) { // 当前 URL 是 https://example.com/blog // 第一个中间件函数 -async function first(_, next) { +async function first(context, next) { console.log(context.url.pathname) // 这里会打印 "/blog" // 重写到一个新的路由,首页 // 返回更新的 `context`,传递给下一个函数