(ctx, next)=>{
if(ctx.path.startsWith(‘/api/v1/auth’)){
ctx.request.query.fileKey = ctx.path.substring(‘/api/v1/auth’.length);
ctx.routerPath = ‘/api/v1/auth’;
ctx.path = ‘/api/v1/auth’;
}
return next();
}
koa 动态更改路由中间件
最新推荐文章于 2024-07-19 00:49:31 发布