config.js
988 Bytes
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
function getUrl() {
let host = window.location.host;
let url = '';
switch (host) {
case 'sc.glsx.com.cn':
url = 'http://sc.glsx.com.cn/admin-supplychain/'
break;
case 'sso.glsx.com.cn':
url = 'http://sso.glsx.com.cn/admin-supplychain/'
break;
default:
url = '/admin-supplychain/'
break;
}
return url;
}
export default {
method: 'post',
// 开发环境
// baseURL: 'https://devwx.glsx.com.cn/cow/mini/',
// 测试环境
// baseURL: 'https://qcwx.glsx.com.cn/cow/mini/',
// baseURL: 'https://'+ baseUrl +'/cow/mini/',
//baseURL: '/admin-supplychain',
baseURL: getUrl(),
// 请求头信息
headers: {
'Content-Type': 'application/json;charset=UTF-8'
/* 'X-Requested-With': 'XMLHttpRequest',
'Access-Control-Allow-Origin':'*' */
},
// 参数
data: {},
// 设置超时时间
timeout: 10000,
// 携带凭证
withCredentials: true,
// 返回数据类型
responseType: 'json'
}