fix(payment-password): 修复 isActive 字段名错误(应为 status !== ACTIVE)

Prisma schema 中 UserAccount 无 isActive 字段,实际为 status VARCHAR(20)。
两处 select 改为 { phoneNumber, status },检查改为 status !== 'ACTIVE'。

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-05 07:05:42 -08:00
parent 6f912b1232
commit 3aa2856770
1 changed files with 4 additions and 4 deletions

View File

@ -2971,11 +2971,11 @@ export class UserApplicationService {
const user = await this.prisma.userAccount.findUnique({ const user = await this.prisma.userAccount.findUnique({
where: { userId: BigInt(userId) }, where: { userId: BigInt(userId) },
select: { phoneNumber: true, isActive: true }, select: { phoneNumber: true, status: true },
}); });
if (!user) throw new ApplicationError('用户不存在'); if (!user) throw new ApplicationError('用户不存在');
if (!user.isActive) throw new ApplicationError('账户已冻结或注销'); if (user.status !== 'ACTIVE') throw new ApplicationError('账户已冻结或注销');
if (!user.phoneNumber) throw new ApplicationError('账户未绑定手机号'); if (!user.phoneNumber) throw new ApplicationError('账户未绑定手机号');
const code = this.generateSmsCode(); const code = this.generateSmsCode();
@ -3008,11 +3008,11 @@ export class UserApplicationService {
const user = await this.prisma.userAccount.findUnique({ const user = await this.prisma.userAccount.findUnique({
where: { userId: BigInt(userId) }, where: { userId: BigInt(userId) },
select: { phoneNumber: true, isActive: true }, select: { phoneNumber: true, status: true },
}); });
if (!user) throw new ApplicationError('用户不存在'); if (!user) throw new ApplicationError('用户不存在');
if (!user.isActive) throw new ApplicationError('账户已冻结或注销'); if (user.status !== 'ACTIVE') throw new ApplicationError('账户已冻结或注销');
if (!user.phoneNumber) throw new ApplicationError('账户未绑定手机号'); if (!user.phoneNumber) throw new ApplicationError('账户未绑定手机号');
// 1. 验证短信验证码 // 1. 验证短信验证码