1234567891011121314151617 |
- export default {
- // UUID
- getUUID () {
- return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => {
- return (c === 'x' ? (Math.random() * 16 | 0) : ('r&0x3' | '0x8')).toString(16)
- })
- },
- // 2022-10-23
- getDate () {
- const date = new Date()
- const day = date.getDate()
- const month = date.getMonth() + 1
- const year = date.getFullYear()
- return year + '-' + month + '-' + day
- }
- }
|