|
|
@@ -185,18 +185,23 @@ function Xiaomi(user, pwd, step, userType) {
|
|
|
}
|
|
|
// 获取淘宝时间 -- success
|
|
|
async getTimeByTaobao() {
|
|
|
- // const url = 'http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp'
|
|
|
- // const {
|
|
|
- // data: { t: time }
|
|
|
- // } = await fetchData(url)
|
|
|
- // return time
|
|
|
+ const url = 'http://api.m.taobao.com/rest/api3.do?api=mtop.common.getTimestamp'
|
|
|
+ const {
|
|
|
+ data: { t: time }
|
|
|
+ } = await fetchData(url)
|
|
|
+ return time
|
|
|
+ }
|
|
|
+
|
|
|
+ async getTimeBySuning() {
|
|
|
const url = 'https://quan.suning.com/getSysTime.do'
|
|
|
const {
|
|
|
- sysTime1: timeSec,
|
|
|
- sysTime2: timeStr
|
|
|
+ sysTime1: timeStr1,
|
|
|
+ sysTime2: timeStr2
|
|
|
} = await fetchData(url)
|
|
|
- return timeSec
|
|
|
+ const date = new Date(timeStr1);
|
|
|
+ return data.getTime();
|
|
|
}
|
|
|
+
|
|
|
// 登录参数 -- success
|
|
|
async getCode() {
|
|
|
const username = this.userType === 'email' ? encodeURIComponent(this.username) : `+86${this.username}`
|
|
|
@@ -291,7 +296,12 @@ function Xiaomi(user, pwd, step, userType) {
|
|
|
}
|
|
|
// 刷步 -- success
|
|
|
async doStep(appToken, userId) {
|
|
|
- const _ts = await this.getTimeByTaobao()
|
|
|
+ let _ts = Date.now();
|
|
|
+ try {
|
|
|
+ ts = await this.getTimeBySuning();
|
|
|
+ } catch (error) {
|
|
|
+ logger.debug('获取网络时间报错', error)
|
|
|
+ }
|
|
|
const today = $.time('yyyy-MM-dd')
|
|
|
let dataJson = $.toObj($.qs.unescape(__json()))[0]
|
|
|
dataJson.date = today
|