1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 03:23:49 +08:00

try to fix #422.

This commit is contained in:
Mrs4s 2020-12-02 22:13:02 +08:00
parent c5a5f71664
commit b23f68e746

View File

@ -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()