添加desktop模式更新

This commit is contained in:
eatMoreApple 2021-05-07 23:47:33 +08:00
parent 738d9aca0e
commit d0238a00ae
2 changed files with 7 additions and 1 deletions

View File

@ -179,7 +179,7 @@ func TestLogout(t *testing.T) {
}
func TestSendMessage(t *testing.T) {
bot := defaultBot()
bot := defaultBot(Desktop)
if err := bot.Login(); err != nil {
t.Error(err)
return

View File

@ -4,6 +4,7 @@ import (
"errors"
"net/http"
"os"
"strings"
)
// 调用请求和解析请求
@ -71,6 +72,11 @@ func (c *Caller) GetLoginInfo(body []byte) (*LoginInfo, error) {
return nil, errors.New("redirect url does not match")
}
path := string(results[1])
if strings.Contains(path, "wx2") {
c.Client.UrlManager = normal
} else {
c.Client.UrlManager = desktop
}
resp := NewReturnResponse(c.Client.GetLoginInfo(path))
if resp.Err() != nil {
return nil, resp.Err()