constant.js 782 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /**
  2. *
  3. * 全局静态变量
  4. * 通过this.$cons.xx调用
  5. *
  6. * created by uu
  7. */
  8. // 环境修改
  9. const ENV = 'dev'
  10. const BASE_URL = '/wf-api'
  11. // 后端多环境配置
  12. const hostConfig = {
  13. dev: "http://tq.5000v.com:8032",
  14. // dev: "http://tq.5000v.com:8025",
  15. test: "",
  16. prod: ""
  17. }
  18. /**
  19. * 前端页面配置(公众号重定向需要)
  20. */
  21. const frontIndexConfig = {
  22. dev: "http://www.diboot.com", // 自行替换
  23. test: "",
  24. prod: ""
  25. }
  26. const cons = {
  27. ENV,
  28. BASE_URL,
  29. /**
  30. * 获取当前环境配置
  31. * @param {Object} env {dev、test、prod}
  32. */
  33. host(env = ENV) {
  34. return `${hostConfig[env]}${BASE_URL}`
  35. },
  36. /**
  37. * 获取当前环境配置
  38. * @param {Object} env {dev、test、prod}
  39. */
  40. frontIndex(env = ENV) {
  41. return frontIndexConfig[env]
  42. }
  43. }
  44. export default cons