// 根据当前日期获取上个月开始时间和结束时间
export const getPreDays = () => {
const num2 = 2;
let date = new Date();
let startTime = new Date(date.getFullYear(), date.getMonth() - 1, 1);
let day = new Date(date.getFullYear(), date.getMonth(), 0).getDate();
let endTime = new Date(date.getFullYear(), date.getMonth() - 1, day);
let m = String(startTime.getMonth() + 1).padStart(num2, '0');
let d1 = `0${startTime.getDate()}`;
let d2 = endTime.getDate();
return [
`${startTime.getFullYear()}-${m}-${d1}`,
`${endTime.getFullYear()}-${m}-${d2}`
];
};