config.js 1.81 KB
/**
 * 用来配置小程序项目的变量
 * 统一管理
 */

/**
 * 环境指定
 * 0本地
 * 1开发
 * 2测试
 * 3生产环境
 * 4预发布
 */
let index = 3

const accountInfo = wx.getAccountInfoSync()
const systemInfo = wx.getSystemInfoSync()
const envName = accountInfo.miniProgram.envVersion
//手动控制体验版环境的请求 true就依据下面index false就默认为2
const manual = false
const release = false

// 判断小程序环境
// develop:开发版 trial:体验版 release:正式版
if (systemInfo.platform != 'devtools') {
  switch (envName) {
    case 'develop':
      break
    case 'trial':
      index = manual ? index : 2
      break
    case 'release':
      index = release ? index : 3
      break
    default:
      index = 3
      break
  }
}

export const env = envName
export const envIndex = index

const createOrderPosterImgUrl = {
  develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/orderDetailPoster?`,
  trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/orderDetailPoster?`,
  release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/orderDetailPoster?`,
  preRelease: `https://dj.beta.glsx.com.cn/dj-car-boutique-work-wechat/#/orderDetailPoster?`
}
const target = ['ip', 'develop', 'trial', 'release', 'preRelease']
// 订单详情地址
export const orderPosterImgUrl = createOrderPosterImgUrl[target[envIndex]]

// 配置预发布的小程序aapId
// export const preReleaseAppId = 'wx24ebae5768e74138'

// 小程序id
// export const appId = 'wx570d9331f9ace0bd'

// sentry Dsn 地址
// export const dsnUrl = 'https://ddaadc52bf8d4ecc92eca632683d456a@sentry.glsx.com.cn/23'

// 图片基地址
// export const ImgUrl = 'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'