From 338554e52114c6cebb4f1bc46332290ef41a3061 Mon Sep 17 00:00:00 2001 From: takayama Date: Tue, 17 May 2022 16:54:40 +0900 Subject: [PATCH] fix login protection --- lib/core/base-client.ts | 2 +- lib/internal/listeners.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/core/base-client.ts b/lib/core/base-client.ts index 312421f5..cf8996fb 100644 --- a/lib/core/base-client.ts +++ b/lib/core/base-client.ts @@ -941,7 +941,7 @@ function decodeLoginResponse(this: BaseClient, payload: Buffer): any { } if (type === 160) { - if (!t[0x204]) + if (!t[0x204] && !t[0x174]) return this.emit("internal.verbose", "已向密保手机发送短信验证码", VerboseLevel.Mark) let phone = "" if (t[0x174] && t[0x178]) { diff --git a/lib/internal/listeners.ts b/lib/internal/listeners.ts index da645e0d..a42bd8ad 100644 --- a/lib/internal/listeners.ts +++ b/lib/internal/listeners.ts @@ -136,7 +136,8 @@ function sliderListener(this: Client, url: string) { } function verifyListener(this: Client, url: string, phone: string) { - this.logger.mark("登录保护二维码验证地址:" + url.replace("verify", "qrcode")) + this.logger.mark("收到登录保护,只需验证一次便长期有效,可以访问URL验证或发短信验证。访问URL完成验证后调用login()可直接登录。发短信验证需要调用sendSmsCode()和submitSmsCode()方法。") + this.logger.mark("登录保护验证URL:" + url.replace("verify", "qrcode")) this.logger.mark("密保手机号:" + phone) return this.em("system.login.device", { url, phone }) }