添加desktop模式更新
This commit is contained in:
parent
738d9aca0e
commit
d0238a00ae
@ -179,7 +179,7 @@ func TestLogout(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestSendMessage(t *testing.T) {
|
func TestSendMessage(t *testing.T) {
|
||||||
bot := defaultBot()
|
bot := defaultBot(Desktop)
|
||||||
if err := bot.Login(); err != nil {
|
if err := bot.Login(); err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
return
|
return
|
||||||
|
@ -4,6 +4,7 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// 调用请求和解析请求
|
// 调用请求和解析请求
|
||||||
@ -71,6 +72,11 @@ func (c *Caller) GetLoginInfo(body []byte) (*LoginInfo, error) {
|
|||||||
return nil, errors.New("redirect url does not match")
|
return nil, errors.New("redirect url does not match")
|
||||||
}
|
}
|
||||||
path := string(results[1])
|
path := string(results[1])
|
||||||
|
if strings.Contains(path, "wx2") {
|
||||||
|
c.Client.UrlManager = normal
|
||||||
|
} else {
|
||||||
|
c.Client.UrlManager = desktop
|
||||||
|
}
|
||||||
resp := NewReturnResponse(c.Client.GetLoginInfo(path))
|
resp := NewReturnResponse(c.Client.GetLoginInfo(path))
|
||||||
if resp.Err() != nil {
|
if resp.Err() != nil {
|
||||||
return nil, resp.Err()
|
return nil, resp.Err()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user