method.js 864 字节
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,
      ymd:year + "-" + month + "-" + date
    }
  },
  async getRequestClassIds(url, siteId, key, startTime, endTime,page) {
    let axiosUrl = `${url}?siteId=${siteId}&key=${key}&from=${startTime}&to=${endTime}&page=${page}`
    let result = await axios.get(axiosUrl)
    return result
  },
}

module.exports = methods