config.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /**
  2. * 生产环境请求地址
  3. * @type {string}
  4. */
  5. const prodURL = '/api/'
  6. /**
  7. * 开发环境请求地址
  8. * @type {string}
  9. */
  10. let devURL = 'http://localhost:8080/api/'
  11. // #ifdef H5
  12. // H5平台
  13. devURL = 'http://localhost:8080/api/'
  14. // #endif
  15. // #ifndef H5
  16. // 非H5平台
  17. devURL = 'http://localhost:8080/api/'
  18. // #endif
  19. const selfURL = ''
  20. /**
  21. * 非APP静态图片资源使用网络地址
  22. * 使用线上地址节省小程序包资源
  23. */
  24. let staticUrl = null
  25. // #ifdef APP-PLUS
  26. staticUrl = '/static/'
  27. // #endif
  28. // #ifndef APP-PLUS
  29. staticUrl = '/static/'
  30. // #endif
  31. // -----------------------------------------------------------------------------------------------------
  32. /**
  33. * 计算请求地址
  34. */
  35. export const BASE_URL_FN = function(flag = false) {
  36. // 生产环境
  37. if (process.env.NODE_ENV === 'production') {
  38. return prodURL
  39. }
  40. // 开发环境
  41. return devURL
  42. }
  43. /**
  44. * 计算静态资源路径
  45. * @param {Object} val
  46. */
  47. export const STATIC_URL_FN = function(val) {
  48. const url = val.startsWith('/') ? val.replace('/', '') : val
  49. if (process.env.NODE_ENV === 'development') return '/static/' + url
  50. return staticUrl + url
  51. }
  52. /**
  53. * 导航默认配置
  54. */
  55. export const DEFAULT_NAV_CONFIG = {
  56. quick: [4, 11, 5, 3], // 快速新建
  57. nav: [1, 2, 3, 11, 12], // 导航
  58. common: [13, 7, 8, 9, 5, 17, 3, 1] // 常用功能
  59. }
  60. /**
  61. * 地图WEB服务API密钥
  62. * 主要用于扩展 uni 自带地图功能
  63. * 高德地图参考:https://lbs.amap.com/api/webservice/summary/
  64. * 腾讯地图参考:https://lbs.qq.com/service/webService/webServiceGuide/webServiceOverview
  65. */
  66. export const mapKey = 'UIDBZ-2QUCR-C6CW5-WSLAN-NWUQO-SOFB7' // 腾讯地图
  67. /**
  68. * app update log
  69. * @example ['优化用户体验', '修复已知bug', '新增***功能']
  70. * @type {Array}
  71. */
  72. export const versionLog = []
  73. /**
  74. * app name
  75. * @type {string}
  76. */
  77. export const appName = 'CRM'
  78. /**
  79. * app version
  80. * @type {string}
  81. */
  82. export const appVersion = '12.0.0.20220317'
  83. /**
  84. * wukong business calls
  85. * @type {string}
  86. */
  87. export const businessCalls = '0817-7777969'
  88. /**
  89. * 公钥
  90. */
  91. export const PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCXSsDQ5jiqzMBbDS8SdwXVyCByv5GwE13PnKipBJb2awmsc0THksjhKgcjW/HCT7GRhUOv4bv4pyTaE2f3xBVmZwut126M6xZvfuds1T10DF7jlUD14oJcpX5W7LKExoIPGYJMq83iyIV7rRT5+Bc80eHQ5hjWZ3lyv5upYWMkjwIDAQAB-----END PUBLIC KEY-----'