完成权限角色守卫
This commit is contained in:
@@ -1,23 +0,0 @@
|
||||
import { Column, CreateDateColumn, Entity, Index, PrimaryGeneratedColumn } from "typeorm";
|
||||
|
||||
@Entity()
|
||||
@Index(['userId', 'roleId'])
|
||||
export class UserRole {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Column('uuid')
|
||||
roleId: string;
|
||||
|
||||
@Column('uuid')
|
||||
userId: string
|
||||
|
||||
@Column()
|
||||
isEnabled: boolean;
|
||||
|
||||
@CreateDateColumn({ precision: 3 })
|
||||
createdAt: Date;
|
||||
|
||||
@Column({ nullable: true, precision: 3 })
|
||||
expiredAt?: Date;
|
||||
}
|
||||
@@ -6,11 +6,10 @@ import { UserService } from './user.service';
|
||||
import { UserSession } from './entities/user-session.entity';
|
||||
import { AuthModule } from 'src/auth/auth.module';
|
||||
import { UserSessionService } from './services/user-session.service';
|
||||
import { UserRole } from './entities/user-role.entity';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TypeOrmModule.forFeature([User, UserSession, UserRole]),
|
||||
TypeOrmModule.forFeature([User, UserSession]),
|
||||
forwardRef(() => AuthModule),// 解决循环依赖问题
|
||||
],
|
||||
controllers: [UserController],
|
||||
|
||||
Reference in New Issue
Block a user