fix(wecom): remove 6-char hex false-positive intercept

The /^[0-9A-F]{6}$/ check in handleMessage intercepted any message
that happened to be 6 uppercase hex chars (e.g. colour codes, words
like FACADE) and told the user their binding code was expired.

Removed: non-matching resolveBindCode result now falls through to
normal agent routing, matching the original behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-03-10 07:02:07 -07:00
parent 61b2778ff0
commit f1bf0a6abc
1 changed files with 0 additions and 5 deletions

View File

@ -607,11 +607,6 @@ export class WecomRouterService implements OnModuleInit, OnModuleDestroy {
); );
return; return;
} }
// 6-char hex pattern but not a valid code → tell user it's expired
if (/^[0-9A-F]{6}$/.test(upperText)) {
await this.sendMessage(msg.externalUserId, '验证码无效或已过期,请重新在 IT0 App 中生成新的验证码。');
return;
}
if (!this.rateAllow(msg.externalUserId)) { if (!this.rateAllow(msg.externalUserId)) {
await this.sendMessage(msg.externalUserId, '消息频率过高请稍后再试每分钟最多10条。'); await this.sendMessage(msg.externalUserId, '消息频率过高请稍后再试每分钟最多10条。');