Skip to content

Commit

Permalink
监听模式二维码识别成功后,处理匹配失败的情况
Browse files Browse the repository at this point in the history
  • Loading branch information
cxOrz committed May 13, 2023
1 parent fd56ffe commit 4ad9462
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/server/src/monitor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,11 @@ async function handleMsg(this: CQ, data: string) {

if (typeof qr_str === 'undefined') this.send('是否已配置腾讯云OCR?图像是否包含清晰二维码?', this.getTargetID());
else {
params.enc = qr_str.match(/(?<=&enc=)[\dA-Z]+/)[0];
params.enc = qr_str.match(/(?<=&enc=)[\dA-Z]+/)?.[0];
const result = await QRCodeSign(params);
this.send(`${result} - ${params.name}`, this.getTargetID());
// 签到成功则清理缓存
result === '[二维码]签到成功' && this.clearCache();
result === '[二维码]签到成功' ? this.clearCache() : this.send(result, this.getTargetID());
}
}
}
Expand Down

0 comments on commit 4ad9462

Please sign in to comment.