util.js 812 B

12345678910111213141516171819202122232425
  1. const globalData = {
  2. publicUrl: 'https://sqdx.jiaxintech.com'//测试地址
  3. // publicUrl: 'https://sqpx.jiaxintech.com'//正式地址
  4. // publicUrl:'http://10.16.10.139'//ly
  5. // publicUrl:'http://10.16.4.19:80'//hyb
  6. // publicUrl:'http://10.16.4.26:80'//zxq
  7. // publicUrl:'http://10.20.1.207:80'//dailin
  8. };
  9. const formatTime = date => {
  10. const year = date.getFullYear()
  11. const month = date.getMonth() + 1
  12. const day = date.getDate()
  13. const hour = date.getHours()
  14. const minute = date.getMinutes()
  15. const second = date.getSeconds()
  16. return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
  17. }
  18. const formatNumber = n => {
  19. n = n.toString()
  20. return n[1] ? n : '0' + n
  21. }
  22. module.exports = {
  23. globalData: globalData,
  24. formatTime: formatTime
  25. }