peng
22 小时以前 4e504b96d245a0c0e4a7b7ff49441a39f31f048c
1
2
3
4
5
6
7
8
9
10
/**
 * 获得当前时间的月份,格式为YYYY-MM
 * @returns {string} 当前时间的月份,格式为YYYY-MM
 */
export function getCurrentMonth() {
      const now = new Date();
      const year = now.getFullYear();
      const month = String(now.getMonth() + 1).padStart(2, '0'); // 月份从0开始,需要+1
      return `${year}-${month}`;
}