()
| 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(() => { |
no test coverage detected