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
// php测试环境
// export const php = 'http://test.pet-dbc.cn/mobile/index.php?'
// php镜像
// export const php = 'https://jingxiang.pet-dbc.cn/mobile/index.php?'
// php正式环境
// export const php = 'https://shop.pet-dbc.cn/mobile/index.php?'
// go测试环境
// export const go = 'https://tm.pet-dbc.cn'
// go镜像环境
// export const go = 'https://jxm.pet-dbc.cn'
// go正式环境
// export const go = 'https://m.pet-dbc.cn';
// 获取php正式环境
export const php = phpfunc();
// 获取跳转白条地址
export const go = gofunc();
/**
* 根据当前域名返回ecmall地址
* */
function phpfunc(){
const { origin } = window.location;
let url = '';
// 测试环境
if(origin.indexOf('local') > -1 || origin.indexOf('test') > -1){
if(origin.indexOf('test') > -1){
url = `${origin}/mobile/index.php?`;
}else{
url = 'https://test.pet-dbc.cn/mobile/index.php?';
}
}else if(origin.indexOf('jingxiang') > -1){
url = 'https://jingxiang.pet-dbc.cn/mobile/index.php?';
}else{
url = 'https://shop.pet-dbc.cn/mobile/index.php?';
}
return url;
}
/**
* 根据当前域名返回白条地址
* */
function gofunc(){
const { origin } = window.location;
let url = '';
// 测试环境
if(origin.indexOf('localhost') > -1 || origin.indexOf('test') > -1){
url = 'https://tm.pet-dbc.cn';
}else if(origin.indexOf('jingxiang') > -1){
url = 'https://jxm.pet-dbc.cn';
}else{
url = 'https://m.pet-dbc.cn';
}
return url;
}