MCPcopy
hub / github.com/nodeWechat/wechat4u / notifyMobile

Method notifyMobile

src/core.js:181–208  ·  view source on GitHub ↗
(to)

Source from the content-addressed store, hash-verified

179 }
180
181 notifyMobile (to) {
182 return Promise.resolve().then(() => {
183 let params = {
184 pass_ticket: this.PROP.passTicket,
185 lang: 'zh_CN'
186 }
187 let data = {
188 'BaseRequest': this.getBaseRequest(),
189 'Code': to ? 1 : 3,
190 'FromUserName': this.user['UserName'],
191 'ToUserName': to || this.user['UserName'],
192 'ClientMsgId': getClientMsgId()
193 }
194 return this.request({
195 method: 'POST',
196 url: this.CONF.API_webwxstatusnotify,
197 params: params,
198 data: data
199 }).then(res => {
200 let data = res.data
201 assert.equal(data.BaseResponse.Ret, 0, res)
202 })
203 }).catch(err => {
204 debug(err)
205 err.tips = '手机状态通知失败'
206 throw err
207 })
208 }
209
210 getContact (seq = 0) {
211 return Promise.resolve().then(() => {

Callers 2

_initMethod · 0.80
checkPollingMethod · 0.80

Calls 2

getBaseRequestMethod · 0.95
getClientMsgIdFunction · 0.90

Tested by

no test coverage detected