export class AppModule implements NestModule{
configure(consumer: MiddlewareConsumer) {
console.log('---');
consumer.apply(LoginMiddleware)
.exclude(
{
path: '/login',
method: RequestMethod.ALL
}
)
.exclude(
{
path: 'login',
method: RequestMethod.ALL
}
)
.exclude(
{
path: '*/login',
method: RequestMethod.ALL
}
)
.exclude(
{
path: '/',
method: RequestMethod.ALL
}
)
.exclude(
'login'
)
.exclude(
'/login'
)
.exclude(
'/login/'
)
.forRoutes(
{
path: '*',
method: RequestMethod.ALL
}
)
}
}
exclude的n种写法都不行,
exclude({path: '*", method: RequestMethod.ALL})是有效的,我上面到底哪里写错了呢### 问题描述
问题出现的环境背景及自己尝试过哪些方法
相关代码
// 请把代码文本粘贴到下方(请勿用图片代替代码)