小说小程序前端代码仓库(小程序)
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.

66 lines
1.4 KiB

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