fix: accept partially reported CMPP signatures

This commit is contained in:
hectorzhao
2026-07-14 11:19:24 +08:00
parent ab29e60ae1
commit f08a73e191
5 changed files with 75 additions and 7 deletions
+4 -5
View File
@@ -1569,7 +1569,7 @@ export class SendChainService implements OnModuleInit, OnModuleDestroy {
} else if (!template && application.templateMismatchMode === 'manual_review') {
const signature = await this.resolveInboundSignatureCandidate(application.id, data.content);
if (!signature) {
await reject('SIGNATURE', '短信内容未识别到已审核且已报备的签名');
await reject('SIGNATURE', '短信内容未识别到已审核通过的签名');
} else {
const risk = await this.riskReview.evaluateTask({
tenantId: application.tenantId,
@@ -2012,14 +2012,13 @@ export class SendChainService implements OnModuleInit, OnModuleDestroy {
}
private resolveInboundSignatureCandidate(applicationId: string, content: string) {
const match = content.match(/^【([^】]+)】/);
if (!match?.[1]) return null;
const match = content.match(/^【[^】]+】/);
if (!match?.[0]) return null;
return this.prisma.smsSignature.findFirst({
where: {
applicationId,
name: match[1],
name: match[0],
auditStatus: 'approved',
reportStatus: 'approved',
},
orderBy: { updatedAt: 'desc' },
});