Skip to content
This repository has been archived by the owner on Nov 2, 2023. It is now read-only.

Commit

Permalink
fix login protection
Browse files Browse the repository at this point in the history
  • Loading branch information
takayama-lily committed May 17, 2022
1 parent e831caf commit 338554e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/core/base-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down
3 changes: 2 additions & 1 deletion lib/internal/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
}
Expand Down

0 comments on commit 338554e

Please sign in to comment.