From 9730d05aa0464aab8ce6f1e40daf72a6867f44fa Mon Sep 17 00:00:00 2001 From: tone Date: Tue, 16 Dec 2025 19:58:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=90=8E=E7=AB=AF=E8=B0=83=E6=95=B4?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=9D=83=E9=99=90=E7=BB=93=E6=9E=84=E4=B8=BA?= =?UTF-8?q?roleItem?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/backend/src/user/entities/user.entity.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/apps/backend/src/user/entities/user.entity.ts b/apps/backend/src/user/entities/user.entity.ts index c5ad7e5..1b5e6d7 100644 --- a/apps/backend/src/user/entities/user.entity.ts +++ b/apps/backend/src/user/entities/user.entity.ts @@ -11,6 +11,12 @@ import { } from 'typeorm'; import { v4 as uuidv4 } from 'uuid'; +export type RoleItem = Role | { + role: Role; + expiresAt?: Date; + [key: string]: any; +} + @Entity() @Index('IDX_user_userid', ['userId'], { unique: true }) @Index('IDX_user_username', ['username'], { unique: true }) @@ -86,6 +92,6 @@ export class User { @DeleteDateColumn({ nullable: true, precision: 3 }) deletedAt: Date; - @Column('simple-array', { default: '' }) - roles: Role[]; + @Column({ type: 'jsonb', default: [] }) + roles: RoleItem[]; }