fix(auth-service): 跳过无手机号/密码的系统账户CDC同步
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
a749a3b9e1
commit
6caae7c860
|
|
@ -124,6 +124,18 @@ export class LegacyUserCdcConsumer implements OnModuleInit, OnModuleDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async upsertLegacyUser(user: UnwrappedCdcUser, sequenceNum: bigint) {
|
private async upsertLegacyUser(user: UnwrappedCdcUser, sequenceNum: bigint) {
|
||||||
|
// 跳过没有手机号的系统账户(user_id 1-5 通常是系统/测试账户)
|
||||||
|
if (!user.phone_number) {
|
||||||
|
this.logger.debug(`Skipped user ${user.user_id} (no phone number)`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 跳过没有密码的账户
|
||||||
|
if (!user.password_hash) {
|
||||||
|
this.logger.debug(`Skipped user ${user.user_id} (no password)`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.prisma.syncedLegacyUser.upsert({
|
await this.prisma.syncedLegacyUser.upsert({
|
||||||
where: { legacyId: BigInt(user.user_id) },
|
where: { legacyId: BigInt(user.user_id) },
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue