config.js
1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* 用来配置小程序项目的变量
* 统一管理
*/
/**
* 环境指定
* 0本地
* 1开发
* 2测试
* 3生产环境
*/
let index = 2
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?`
}
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'