fix QrCode login error

This commit is contained in:
xiaoyaofenfen 2022-12-01 14:13:08 +08:00
parent 1c454060c1
commit 077d18f471

View File

@ -147,10 +147,11 @@ func RunLogin(useQrCodeLogin bool, refreshToken string) (tokenId, refreshTokenSt
// handler waiting
line := cmdliner.NewLiner()
var qrCodeLoginResult *panlogin.QRCodeLoginResult
queryResult := true
defer line.Close()
go func() {
for {
for queryResult {
time.Sleep(3 * time.Second)
qr, er := h.GetQRCodeLoginResult(qrCodeUrlResult.TokenId)
if er != nil {
@ -169,6 +170,7 @@ func RunLogin(useQrCodeLogin bool, refreshToken string) (tokenId, refreshTokenSt
line.State.Prompt("请在浏览器里面完成扫码登录然后再按Enter键继续...")
if qrCodeLoginResult == nil {
queryResult = false
return "", "", aliyunpan.WebLoginToken{}, fmt.Errorf("二维码登录失败")
}