/*
 * @Descripttion:
 * @Company: 思宏科技
 * @version: v1.0
 * @Author: HJ
 * @Date: 2021-08-11 18:28:22
 * @LastEditors: HJ
 * @LastEditTime: 2021-11-11 12:08:46
 */
/*
 * @Descripttion: HJ
 * @Company: 思宏科技
 * @version: v1.0
 * @Author: HJ
 * @Date: 2021-08-03 14:19:14
 * @LastEditors: HJ
 * @LastEditTime: 2021-08-11 18:25:15
 */
const _DEFAULT = {
  miniProgram: { envVersion: 'trial', appId: 'wxc860fb60438d6e4f' }
}
const {
  miniProgram: { envVersion, appId }
} = uni.getAccountInfoSync() || _DEFAULT

const dev = {
  appId,
  appSecret: 'bf0ae3512f4c12f883c82b76fb121639',
  env: 'dev',
  baseUrl: 'https://ybm-dev.thinkmacro.cn'
}
// 测试
const test = {
  appId,
  appSecret: 'bf0ae3512f4c12f883c82b76fb121639',
  env: 'test',
  baseUrl: 'https://ybm-dev.thinkmacro.cn'
}
// 生产
const prod = {
  appId,
  appSecret: 'bf0ae3512f4c12f883c82b76fb121639',
  env: 'prod',
  baseUrl: 'https://ybm-dev.thinkmacro.cn'
}

const envConfig = new Map([
  ['develop', dev],
  ['trial', test],
  ['release', prod]
])

const config = envVersion ? envConfig.get(envVersion) || test : test
uni.$env = config
export default config
