From db610f392ad3045798a504bd1bf0d61c283811ae Mon Sep 17 00:00:00 2001 From: onism Date: Fri, 16 Apr 2021 16:10:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E5=8F=98=E6=9B=B4?= =?UTF-8?q?=E4=B8=BAwx.qq.com?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- global.go | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/global.go b/global.go index 5f76932..3aec1bc 100644 --- a/global.go +++ b/global.go @@ -15,28 +15,28 @@ var ( const ( appId = "wx782c26e4c19acffb" - baseUrl = "https://wx2.qq.com" + baseUrl = "https://wx.qq.com" jsLoginUrl = "https://login.wx.qq.com/jslogin" webWxNewLoginPage = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage" qrcodeUrl = "https://login.weixin.qq.com/qrcode/" loginUrl = "https://login.wx.qq.com/cgi-bin/mmwebwx-bin/login" - webWxInitUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxinit" - webWxStatusNotifyUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxstatusnotify" - webWxSyncUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxsync" - webWxSendMsgUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg" - webWxGetContactUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxgetcontact" - webWxSendMsgImgUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsgimg" - webWxSendAppMsgUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxsendappmsg" - webWxBatchGetContactUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxbatchgetcontact" - webWxOplogUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxoplog" - webWxVerifyUserUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxverifyuser" - syncCheckUrl = "https://webpush.wx2.qq.com/cgi-bin/mmwebwx-bin/synccheck" - webWxUpLoadMediaUrl = "https://file.wx2.qq.com/cgi-bin/mmwebwx-bin/webwxuploadmedia" - webWxGetMsgImgUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxgetmsgimg" - webWxGetVoiceUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxgetvoice" - webWxGetVideoUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxgetvideo" - webWxLogoutUrl = "https://wx2.qq.com/cgi-bin/mmwebwx-bin/webwxlogout" - webWxGetMediaUrl = "https://file.wx2.qq.com/cgi-bin/mmwebwx-bin/webwxgetmedia" + webWxInitUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxinit" + webWxStatusNotifyUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxstatusnotify" + webWxSyncUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsync" + webWxSendMsgUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsg" + webWxGetContactUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetcontact" + webWxSendMsgImgUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendmsgimg" + webWxSendAppMsgUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxsendappmsg" + webWxBatchGetContactUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxbatchgetcontact" + webWxOplogUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxoplog" + webWxVerifyUserUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxverifyuser" + syncCheckUrl = "https://webpush.wx.qq.com/cgi-bin/mmwebwx-bin/synccheck" + webWxUpLoadMediaUrl = "https://file.wx.qq.com/cgi-bin/mmwebwx-bin/webwxuploadmedia" + webWxGetMsgImgUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetmsgimg" + webWxGetVoiceUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetvoice" + webWxGetVideoUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetvideo" + webWxLogoutUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxlogout" + webWxGetMediaUrl = "https://file.wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetmedia" jsonContentType = "application/json; charset=utf-8" ) From 325ad6d86e5c5f75738b395bb8a05bb2d097b643 Mon Sep 17 00:00:00 2001 From: onism Date: Fri, 16 Apr 2021 16:12:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=B7=BB=E5=8A=A0uos=E8=AF=B7=E6=B1=82?= =?UTF-8?q?=E5=A4=B4=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client.go | 9 ++++++--- global.go | 6 ++++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/client.go b/client.go index cb26a00..3c7b941 100644 --- a/client.go +++ b/client.go @@ -70,9 +70,12 @@ func (c *Client) CheckLogin(uuid string) (*http.Response, error) { return c.Get(path.String()) } -// 请求获取LoginInfo +// GetLoginInfo 请求获取LoginInfo func (c *Client) GetLoginInfo(path string) (*http.Response, error) { - return c.Get(path) + req, _ := http.NewRequest(http.MethodGet, path, nil) + req.Header.Add("client-version", uosPatchClientVersion) + req.Header.Add("extspam", uosPatchExtspam) + return c.Do(req) } // 请求获取初始化信息 @@ -305,7 +308,7 @@ func (c *Client) WebWxSendAppMsg(msg *SendMessage, request *BaseRequest) (*http. } // 用户重命名接口 -func (c *Client) WebWxOplog(request *BaseRequest, remarkName, userName string, ) (*http.Response, error) { +func (c *Client) WebWxOplog(request *BaseRequest, remarkName, userName string) (*http.Response, error) { path, _ := url.Parse(webWxOplogUrl) params := url.Values{} params.Add("lang", "zh_CN") diff --git a/global.go b/global.go index 3aec1bc..d1ae845 100644 --- a/global.go +++ b/global.go @@ -17,7 +17,7 @@ const ( baseUrl = "https://wx.qq.com" jsLoginUrl = "https://login.wx.qq.com/jslogin" - webWxNewLoginPage = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage" + webWxNewLoginPage = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxnewloginpage?mod=desktop" qrcodeUrl = "https://login.weixin.qq.com/qrcode/" loginUrl = "https://login.wx.qq.com/cgi-bin/mmwebwx-bin/login" webWxInitUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxinit" @@ -38,7 +38,9 @@ const ( webWxLogoutUrl = "https://wx.qq.com/cgi-bin/mmwebwx-bin/webwxlogout" webWxGetMediaUrl = "https://file.wx.qq.com/cgi-bin/mmwebwx-bin/webwxgetmedia" - jsonContentType = "application/json; charset=utf-8" + jsonContentType = "application/json; charset=utf-8" + uosPatchClientVersion = "2.0.0" + uosPatchExtspam = "Gp8ICJkIEpkICggwMDAwMDAwMRAGGoAI1GiJSIpeO1RZTq9QBKsRbPJdi84ropi16EYI10WB6g74sGmRwSNXjPQnYUKYotKkvLGpshucCaeWZMOylnc6o2AgDX9grhQQx7fm2DJRTyuNhUlwmEoWhjoG3F0ySAWUsEbH3bJMsEBwoB//0qmFJob74ffdaslqL+IrSy7LJ76/G5TkvNC+J0VQkpH1u3iJJs0uUYyLDzdBIQ6Ogd8LDQ3VKnJLm4g/uDLe+G7zzzkOPzCjXL+70naaQ9medzqmh+/SmaQ6uFWLDQLcRln++wBwoEibNpG4uOJvqXy+ql50DjlNchSuqLmeadFoo9/mDT0q3G7o/80P15ostktjb7h9bfNc+nZVSnUEJXbCjTeqS5UYuxn+HTS5nZsPVxJA2O5GdKCYK4x8lTTKShRstqPfbQpplfllx2fwXcSljuYi3YipPyS3GCAqf5A7aYYwJ7AvGqUiR2SsVQ9Nbp8MGHET1GxhifC692APj6SJxZD3i1drSYZPMMsS9rKAJTGz2FEupohtpf2tgXm6c16nDk/cw+C7K7me5j5PLHv55DFC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