function p(s) { return s < 10 ? '0' + s : s } // 时间格式 export function DateConversion(time) { const d = new Date(time) const resDate = d.getFullYear() + '-' + p(d.getMonth() + 1) + '-' + p(d.getDate()) return resDate } // 时间戳生成随机ID export const randomId = (randomLength = 10) => { return Number(Math.random().toString().substr(3, randomLength) + Date.now()).toString(36) }