0.0.3 • Published 3 years ago

@cyyjs/nestjs-auth v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

nestjs 授权封装

安装

yarn add @cyyjs/nestjs-auth

auth

使用 jwt授权

import { AuthModule, RolesGuard } from '@cyyjs/nestjs-auth'
@Module({
  imports: [
    AuthModule.register({
      url: '' // 获取用户信息的url
    })
  ],
  controllers: [AppController],
  providers: [
    {
      provide: APP_GUARD,
      useClass: RolesGuard
    },
    AppService
  ],
})
export class AppModule {}