fix(治理): 完成任务 8 安全与通知闭环修复

- 串行化拉黑、处罚、投瓶和匹配策略检查\n- 完成异步站内通知、未读统计和偏好并发语义\n- 补齐后台查询审计、处罚恢复和隐私测试\n- 稳定 Redis 恢复、匹配锁序及超时测试
This commit is contained in:
root
2026-09-17 13:08:55 +08:00
parent ce8e1db279
commit fa0fa78312
29 changed files with 1231 additions and 153 deletions
+12
View File
@@ -148,6 +148,18 @@ export class AuthService {
});
if (!account) account = await this.createAccount(phone, digest);
if (account.status !== "ACTIVE") throw this.invalid();
const now = new Date();
const sanction = await this.prisma.sanction.findFirst({
where: {
accountId: account.id,
type: { in: ["SUSPENSION", "BAN"] },
revokedAt: null,
startsAt: { lte: now },
OR: [{ expiresAt: null }, { expiresAt: { gt: now } }],
},
select: { id: true },
});
if (sanction) throw this.invalid();
return this.createSession(account, deviceId);
}
private async createAccount(phone: string, digest: string): Promise<Account> {