添加desktop模式更新
This commit is contained in:
parent
738d9aca0e
commit
d0238a00ae
@ -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
|
||||
|
@ -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()
|
||||
|
Loading…
x
Reference in New Issue
Block a user