feat: auth guard 增加
This commit is contained in:
1 parent
346742b157
commit
a2ee53f83a
11 files changed
+245
-6
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { InjectRepository } from '@nestjs/typeorm';
|
||||
import { User } from '../entity/user.entity';
|
||||
import { Repository } from 'typeorm';
|
||||
|
||||
@Injectable()
|
||||
export class UserService {
|
||||
constructor(
|
||||
@InjectRepository(User) private readonly userRepository: Repository<User>,
|
||||
) {}
|
||||
async findById(id: string) {
|
||||
return this.userRepository.findOne({
|
||||
where: {
|
||||
id,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user