king
2020-09-09 89a7fc9d207ea1b810f663cab27ba375c35f431a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
export default class Utils {
  constructor () {
 
  }
 
  /**
   * @description 获取当前时间
   */
  static getCurrentTime () {
    let _date = new Date()
    let month = _date.getMonth() + 1
    let day = _date.getDate()
    let hour = _date.getHours()
    let minute = _date.getMinutes()
    let second = _date.getSeconds()
    
    return `${_date.getFullYear()}-${month < 10 ? '0' + month : month}-${day < 10 ? '0' + day : day} ${hour < 10 ? '0' + hour : hour}:${minute < 10 ? '0' + minute : minute}:${second < 10 ? '0' + second : second}.000`
  }
 
  /**
   * @description 获取uuid
   */
  static getuuid () {
    let uuid = []
    let _options = '0123456789abcdefghigklmnopqrstuv'
    for (let i = 0; i < 32; i++) {
      uuid.push(_options.substr(Math.floor(Math.random() * 0x20), 1))
    }
    
    return uuid.join('')
  }
}