company/src/utils/util.js
@@ -67,3 +67,11 @@ return age; } // 获取当前日期 export function getDate() { let currentDate = new Date(); let year = currentDate.getFullYear(); // 获取当前年份 let month = currentDate.getMonth() + 1; // 获取当前月份,注意月份从0开始,所以要加1 let day = currentDate.getDate(); // 获取当前日期 return `${year}-${month}-${day}` }