1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-04 19:17:38 +08:00

fix connect.

This commit is contained in:
Mrs4s 2021-04-04 14:26:54 +08:00
parent 4533d5cece
commit 741de4e6e8

View File

@ -246,11 +246,13 @@ func (c *QQClient) Login() (*LoginResponse, error) {
if c.Online {
return nil, ErrAlreadyOnline
}
err := c.connect()
if err != nil {
return nil, err
if c.Conn == nil {
err := c.connect()
if err != nil {
return nil, err
}
go c.netLoop()
}
go c.netLoop()
rsp, err := c.sendAndWait(c.buildLoginPacket())
if err != nil {
c.Disconnect()