config.js
3.28 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/**
* 用来配置小程序项目的变量
* 统一管理
*/
// 配置预发布的小程序aapId
export const preReleaseAppId = 'wx96c8f2a3e76907cb'
// 小程序id
export const appId = 'wx570d9331f9ace0bd'
/**
* 环境指定
* 0本地
* 1开发
* 2测试
* 3生产环境
* 4预发布
* 5cdptest
*/
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') {
if (accountInfo.miniProgram.appId == preReleaseAppId) {
index = 4
} else {
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 createQuotedUrl = {
develop: `http://192.168.1.178:9528/dj-scrm-wx-work-main-zhangls/#/equityPoster?id=`,
trial: `http://frontend.test.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
release: `https://dj.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`,
preRelease: `https://dj.beta.glsx.com.cn/dj-car-boutique-work-wechat/#/equityPoster?id=`
}
const scoketURL = {
develop: `ws://192.168.3.191:7865`,
trial: `ws://salesgpt.test.glsx.com.cn`,
release: `wss://salesgpt.glsx.com.cn`,
preRelease: `ws://salesgpt.test.glsx.com.cn`
}
const target = ['ip', 'develop', 'trial', 'release', 'preRelease']
const ALIYUN_LIST = [
{
AKID: 'LTAI5tJday6R4sng1jgrgH3N', //个人
AKKEY: 'TWvwaQqwjxw7Tj7RlnTxyEXjOjQgFh',
APPKEY: 'a1HmjrmQNv6yT8zb',
URL: 'wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1'
},
{
AKID: 'LTAI5tCSaRbXmWhF7cR6k626', //公司
AKKEY: 'jYHkk6rR6UoaZWikxDTuAUNwJycJwb',
APPKEY: 'Pm7teJgylXGPnPvO',
URL: 'wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1'
},
{
AKID: 'LTAI5tCv6tv55tZVyV4uQKd6', //个人
AKKEY: 'K3eko04dQ88KWltUEbY3A7h5twdjJk',
APPKEY: 'xKQ7JCyBsyNFjUdL',
URL: 'wss://nls-gateway-cn-shanghai.aliyuncs.com/ws/v1'
}
]
export const ALIYUN = ALIYUN_LIST[1]
// 报价单图片地址
export const quotedImgUrl = createQuotedUrl[target[envIndex]]
export const scoket_url = scoketURL[target[envIndex]]
// sentry Dsn 地址
export const dsnUrl =
'https://6b10bd312d154ff3a4664772bb4e50f5@sentry.glsx.com.cn/49'
// 图片基地址
export const ImgUrl =
'https://img02.glsx.com.cn/weapp/resource/dj-car-boutique-work-wechat'
export const ossConfig = {
// 请求域名 格式:https://xxx.xxx.com
HTTP_REQUEST_URL: 'http://127.0.0.1:8000/api',
// 阿里云oss域名 格式:https://xxx.oss-cn-xxx.aliyuncs.com
OSS_DOMAIN: 'https://glsk-oss.oss-cn-shenzhen.aliyuncs.com',
// 文件直传到阿里云oss时需用到
ACCESSKEYID: 'LTAI5tCRcCUgd7bt1J7JY596',
ACCESSKEYSECRET: 'kJos9mgylkR5ztosnDt8Asrc3ulgqy',
BUKET_NAME: 'glsk-oss',
FOLDER: 'quality/',
// 与后端约定的token字段名
TOKEN_NAME: 'glsk-oss'
}
export const bytedanceConfig = {
url: 'https://openspeech.bytedance.com/api/v1/tts'
}