util.js 767 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. };
  8. const formatTime = date => {
  9. const year = date.getFullYear()
  10. const month = date.getMonth() + 1
  11. const day = date.getDate()
  12. const hour = date.getHours()
  13. const minute = date.getMinutes()
  14. const second = date.getSeconds()
  15. return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':')
  16. }
  17. const formatNumber = n => {
  18. n = n.toString()
  19. return n[1] ? n : '0' + n
  20. }
  21. module.exports = {
  22. globalData: globalData,
  23. formatTime: formatTime
  24. }