MCPcopy Index your code
hub / github.com/nodeWechat/wechat4u / syncCheck

Method syncCheck

src/core.js:306–336  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

304 }
305
306 syncCheck () {
307 return Promise.resolve().then(() => {
308 let params = {
309 'r': +new Date(),
310 'sid': this.PROP.sid,
311 'uin': this.PROP.uin,
312 'skey': this.PROP.skey,
313 'deviceid': getDeviceID(),
314 'synckey': this.PROP.formatedSyncKey
315 }
316 return this.request({
317 method: 'GET',
318 url: this.CONF.API_synccheck,
319 params: params
320 }).then(res => {
321 let window = {
322 synccheck: {}
323 }
324
325 // eslint-disable-next-line
326 eval(res.data)
327 assert.equal(window.synccheck.retcode, this.CONF.SYNCCHECK_RET_SUCCESS, res)
328
329 return window.synccheck.selector
330 })
331 }).catch(err => {
332 debug(err)
333 err.tips = '同步失败'
334 throw err
335 })
336 }
337
338 sync () {
339 return Promise.resolve().then(() => {

Callers 1

syncPollingMethod · 0.80

Calls 1

getDeviceIDFunction · 0.90

Tested by

no test coverage detected