install.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import Vue from 'vue';
  2. import md5 from 'js-md5';
  3. import {
  4. md,
  5. geTel,
  6. formatRichText,
  7. saveSceneQrcodeDetail,
  8. noMultipleClicks,
  9. savePullVipcode,
  10. is_weixin,
  11. delStorageSync,
  12. copyH5,
  13. getLocationValue,
  14. } from '@/utils/common';
  15. // #ifdef H5
  16. import wx from '../utils/js_sdk/weixin';
  17. import { authorizeH5, getCode, postCode } from '@/utils/authorizeH5';
  18. // #endif
  19. import { location } from '@/utils/location';
  20. import CacheTool from '@/utils/cache-tool.js';
  21. CacheTool.init();
  22. import {
  23. KIP_APP_PATH,
  24. ETCP_APP_PATH,
  25. ETCP_APP_INVOICE_PATH,
  26. } from '@/constants.js';
  27. import cacheTool from '@/utils/cache-tool';
  28. Vue.prototype.$md5 = md5;
  29. Vue.prototype.$md = md;
  30. Vue.prototype.$location = location;
  31. Vue.prototype.$geTel = geTel;
  32. Vue.prototype.$formatRichText = formatRichText;
  33. Vue.prototype.$saveSceneQrcodeDetail = saveSceneQrcodeDetail;
  34. Vue.prototype.$noMultipleClicks = noMultipleClicks;
  35. Vue.prototype.$savePullVipcode = savePullVipcode;
  36. // 页面的 onLoad 在 onLaunch 之后执行
  37. Vue.prototype.$onLaunched = new Promise((resolve) => {
  38. Vue.prototype.$isResolve = resolve;
  39. });
  40. // #ifdef MP-WEIXIN
  41. Vue.prototype.$userName = 'sys_miniprogram';
  42. // #endif
  43. // #ifdef H5
  44. Vue.prototype.$wx = wx;
  45. Vue.prototype.$authorizeH5 = authorizeH5;
  46. Vue.prototype.$getCode = getCode;
  47. Vue.prototype.$postCode = postCode;
  48. Vue.prototype.$delStorageSync = delStorageSync;
  49. Vue.prototype.$copyH5 = copyH5;
  50. Vue.prototype.$userName = 'sys_gzh';
  51. Vue.prototype.$getLocationValue = getLocationValue;
  52. // #endif
  53. // Local环境
  54. // Vue.prototype.$baseURL = 'https://192.168.2.5:8081/xcrm-api/'
  55. // Vue.prototype.$baseURLH5 = 'https://192.168.2.5:8081/aifengleh5/'
  56. // Vue.prototype.$wsBaseURL = 'wss://192.168.2.5:8081/xcrm-api'
  57. // Vue.prototype.$picUrl = 'https://dev-crm-kpl.kerryonvip.com/upload/'
  58. // DEV环境 DEV_28ae
  59. // Vue.prototype.$baseURL = 'https://dev-crm-kpl.kerryonvip.com/xcrm-api/'
  60. // Vue.prototype.$baseURLH5 = 'https://dev-crm-kpl.kerryonvip.com/aifengleh5/'
  61. // Vue.prototype.$wsBaseURL = 'wss://dev-crm-kpl.kerryonvip.com/xcrm-api'
  62. // Vue.prototype.$picUrl = 'https://dev-crm-kpl.kerryonvip.com/upload/'
  63. // Vue.prototype.$kipPaymentUrl = 'https://dev-payment.kerryonvip.com/'
  64. // Vue.prototype.$kipAppId = 'wx92c3e55fbef6b2af'
  65. // Vue.prototype.$kipAppPath = '/pages/tabbar/home/home'
  66. // QA环境 QA_a4d6
  67. // Vue.prototype.$baseURL = 'https://qa-crm-kpl.kerryprops.com.cn/xcrm-api/'
  68. // Vue.prototype.$baseURLH5 = 'https://qa-crm-kpl.kerryprops.com.cn/aifengleh5/'
  69. // Vue.prototype.$wsBaseURL = 'wss://qa-crm-kpl.kerryprops.com.cn/xcrm-api'
  70. // Vue.prototype.$picUrl = 'https://cnsh-kerry-crm-le.oss-cn-shanghai.aliyuncs.com'
  71. // Vue.prototype.$kipPaymentUrl = 'https://qa-payment.kerryplus.com'
  72. // Vue.prototype.$kipAppId = 'wx92c3e55fbef6b2af'
  73. // Vue.prototype.$kipAppPath = '/pages/tabbar/home/home'
  74. // PROD环境
  75. // Vue.prototype.$baseURL = 'https://crm.kerryplus.com/xcrm-api/'
  76. // Vue.prototype.$baseURLH5 = 'https://crm.kerryplus.com/aifengleh5/'
  77. // Vue.prototype.$wsBaseURL = 'wss://crm.kerryplus.com/xcrm-api'
  78. // Vue.prototype.$picUrl = 'https://cnsh-kerry-crm-prod.oss-cn-shanghai.aliyuncs.com'
  79. // Vue.prototype.$kipPaymentUrl = 'https://apim.kerryplus.com/c/api/payment/v1/'
  80. // Vue.prototype.$kipAppId = 'wx92c3e55fbef6b2af'
  81. // Vue.prototype.$kipAppPath = '/pages/tabbar/home/home'
  82. const curEnvConst = CacheTool.getCurEnvConst();
  83. // console.log(8989, curEnvConst.KIP_PAYMENT_URL)
  84. Vue.prototype.$baseURL = curEnvConst.BASE_URL;
  85. Vue.prototype.$baseURLH5 = curEnvConst.BASE_URL_H5;
  86. Vue.prototype.$wsBaseURL = curEnvConst.WS_BASE_URL;
  87. Vue.prototype.$picUrl = curEnvConst.PIC_URL;
  88. Vue.prototype.$kipPaymentUrl = curEnvConst.KIP_PAYMENT_URL;
  89. Vue.prototype.$kipAppId = curEnvConst.KIP_APPID;
  90. Vue.prototype.$kipAppPath = KIP_APP_PATH;
  91. Vue.prototype.$etcpAppId = curEnvConst.ETCP_APPID;
  92. Vue.prototype.$etcpAppPath = ETCP_APP_PATH;
  93. Vue.prototype.$etcpAppInvoicePath = ETCP_APP_INVOICE_PATH;
  94. // 静态图片前缀(不用改)
  95. Vue.prototype.$staticPicUrl =
  96. 'https://hafeng-admin.oss-cn-beijing.aliyuncs.com';