0

我正在将我的代码更新到 v5,并且我希望有一个像我在上一个代码中那样影响所有路线的病房,但我不知道如何在新版本中做到这一点。我附上我的旧代码。

    @Module({
        components: [AuthService, JwtStrategy, Config],
        controllers: [AuthenticateController],
    })
    
    export class AuthModule implements NestModule {
        

public configure(consumer: MiddlewaresConsumer) {
        consumer
            .apply(passport.authenticate('jwt', { session: false }))
            .forRoutes({ path: '*', method: RequestMethod.ALL });
    }
}
4

1 回答 1

0

是问题的解决方案

于 2018-05-14T14:23:02.540 回答