util.js 698 B

12345678910111213141516171819202122232425
  1. export const formatTime = (date) => {
  2. const year = date.getFullYear()
  3. const month = date.getMonth() + 1
  4. const day = date.getDate()
  5. const hour = date.getHours()
  6. const minute = date.getMinutes()
  7. const second = date.getSeconds()
  8. return (
  9. [year, month, day].map(formatNumber).join('-') +
  10. ' ' +
  11. [hour, minute].map(formatNumber).join(':')
  12. )
  13. }
  14. const formatNumber = (n) => {
  15. const s = n.toString()
  16. return s[1] ? s : '0' + s
  17. }
  18. // export const API_BASE_URL = 'http://192.168.0.135:8015/'
  19. // export const API_BASE_URL = 'http://192.168.20.55:8047/'
  20. export const API_BASE_URL = 'https://hnbwgwx.4dage.com/'
  21. export const CDN_URL = 'https://culture.4dage.com/hn_museum_game/'