mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-04 19:17:37 +08:00
try to fix #422.
This commit is contained in:
parent
c5a5f71664
commit
b23f68e746
@ -112,6 +112,7 @@ func (s *webServer) Dologin() {
|
||||
cli := s.Cli
|
||||
cli.AllowSlider = true
|
||||
rsp, err := cli.Login()
|
||||
count := 0
|
||||
for {
|
||||
global.Check(err)
|
||||
var text string
|
||||
@ -193,6 +194,12 @@ func (s *webServer) Dologin() {
|
||||
if strings.Contains(msg, "版本") {
|
||||
msg = "密码错误或账号被冻结"
|
||||
}
|
||||
if strings.Contains(msg, "上网环境") && count < 5 {
|
||||
cli.Disconnect()
|
||||
rsp, err = cli.Login()
|
||||
count++
|
||||
continue
|
||||
}
|
||||
log.Warnf("登录失败: %v", msg)
|
||||
log.Infof("按 Enter 继续....")
|
||||
readLine()
|
||||
|
Loading…
x
Reference in New Issue
Block a user