推广小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.2 KiB

2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
  1. import Vue from 'vue'
  2. import api from '@/api/api.js'
  3. import utils from './utils/utils.js'
  4. import uvUI from '@/uni_modules/uv-ui-tools'
  5. Vue.use(uvUI);
  6. // 当前环境
  7. const type = 'prod'
  8. // 环境配置
  9. const config = {
  10. dev : {
  11. baseUrl : 'https://popularize-admin.hhlm1688.com/popularize-admin',
  12. // baseUrl : 'http://h5.xzaiyp.top/popularize-admin',
  13. },
  14. prod : {
  15. // baseUrl : 'http://h5.xzaiyp.top/popularize-admin',
  16. baseUrl : 'https://popularize-admin.hhlm1688.com/popularize-admin',
  17. }
  18. }
  19. // 默认配置
  20. const defaultConfig = {
  21. mapKey : 'XMBBZ-BCPCV-SXPPQ-5Y7MY-PHZXK-YFFVU',
  22. aliOss : {
  23. url : 'https://tennis-oss.xzaiyp.top/',
  24. config : {
  25. //桶的地址
  26. region: 'oss-cn-guangzhou',
  27. //id
  28. accessKeyId:'LTAI5tNycA46YTwm383dRvMV',
  29. //密钥
  30. accessKeySecret:'tAdbYQCmdur6jbZ8hjvgB7T1Z52mIG',
  31. //桶的名字
  32. bucket: 'zhuoqiu-image',
  33. endpoint:'oss-cn-guangzhou.aliyuncs.com',
  34. }
  35. },
  36. }
  37. uni.$uv.setConfig({
  38. // 修改$uv.config对象的属性
  39. config: {
  40. // 修改默认单位为rpx,相当于执行 uni.$uv.config.unit = 'rpx'
  41. unit: 'rpx'
  42. },
  43. })
  44. Vue.prototype.$config = utils.deepMergeObject(defaultConfig, config[type])
  45. Vue.prototype.$api = api
  46. export default Vue.prototype.$config