method.js
803 字节
const axios = require('axios');
const methods = {
YesterdayTime() {
let YesterdayTime = (new Date).getTime() - 24 * 60 * 60 * 1000
let YesterdayTimeDate = new Date(YesterdayTime)
let year = YesterdayTimeDate.getFullYear()
let month = YesterdayTimeDate.getMonth() + 1
let date = YesterdayTimeDate.getDate()
let startTime = new Date(year + "-" + month + "-" + date + " 5:30:00").getTime()
let endTime = new Date(year + "-" + month + "-" + date + " 23:59:00").getTime()
return {
startTime,
endTime
}
},
async getRequestClassIds(url, siteId, key, startTime, endTime) {
let axiosUrl = `${url}?siteId=${siteId}&key=${key}&from=${startTime}&to=${endTime}`
let result = await axios.get(axiosUrl)
return result
},
}
module.exports = methods