From f7f8a3b3e4cae7bb5971b55e37aef4b6270141c5 Mon Sep 17 00:00:00 2001 From: tone <3341154833@qq.com> Date: Mon, 12 May 2025 12:09:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4user=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=EF=BC=8C=E5=8E=BB=E6=8E=89id?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tone-page-server/src/user/entities/user.entity.ts | 5 +---- tone-page-server/src/user/user.service.ts | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/tone-page-server/src/user/entities/user.entity.ts b/tone-page-server/src/user/entities/user.entity.ts index f7eebe2..5b79091 100644 --- a/tone-page-server/src/user/entities/user.entity.ts +++ b/tone-page-server/src/user/entities/user.entity.ts @@ -7,10 +7,7 @@ import { v4 as uuidv4 } from 'uuid'; @Index("IDX_user_email", ["email"], { unique: true, where: "email IS NOT NULL" }) @Index("IDX_user_phone", ["phone"], { unique: true, where: "phone IS NOT NULL" }) export class User { - @PrimaryGeneratedColumn() - id: number; - - @Column('uuid', { default: () => 'gen_random_uuid()' }) + @PrimaryGeneratedColumn('uuid') userId: string; @Column({ length: 32 }) diff --git a/tone-page-server/src/user/user.service.ts b/tone-page-server/src/user/user.service.ts index 15ee244..1844f18 100644 --- a/tone-page-server/src/user/user.service.ts +++ b/tone-page-server/src/user/user.service.ts @@ -46,7 +46,7 @@ export class UserService { if (!existingUser) { throw new BadRequestException('User not found'); } - await this.userRepository.softDelete(existingUser.id); + await this.userRepository.softDelete(existingUser.userId); } hashPassword(password: string, salt: string): string {