|
@@ -4,11 +4,13 @@ import wx from 'weixin-jsapi'
|
4
|
4
|
// #endif
|
5
|
5
|
let path = "";
|
6
|
6
|
let appIp = "";
|
|
7
|
+let dsHost = "";
|
7
|
8
|
// #ifdef H5
|
8
|
9
|
let domainName = location.host; //域名+端口
|
9
|
10
|
let protocolName = document.location.protocol; //http协议
|
10
|
11
|
let wsName = protocolName === 'http:' ? 'ws' : 'wss'; //ws协议
|
11
|
|
-path = `${protocolName}//${domainName}/service`
|
|
12
|
+path = `${protocolName}//${domainName}/service`;
|
|
13
|
+dsHost = location.hostname;
|
12
|
14
|
// #endif
|
13
|
15
|
uni.setStorageSync('path', path);
|
14
|
16
|
|
|
@@ -20,7 +22,8 @@ export function get(url, data = {}) {
|
20
|
22
|
url,
|
21
|
23
|
data,
|
22
|
24
|
header: {
|
23
|
|
- 'Cache-Control': 'no-cache'
|
|
25
|
+ 'Cache-Control': 'no-cache',
|
|
26
|
+ 'Ds-Host': dsHost,
|
24
|
27
|
},
|
25
|
28
|
success(res) {
|
26
|
29
|
resolve(res.data);
|
|
@@ -47,7 +50,8 @@ export function post(url, data = {}) {
|
47
|
50
|
url,
|
48
|
51
|
data,
|
49
|
52
|
header: {
|
50
|
|
- 'Cache-Control': 'no-cache'
|
|
53
|
+ 'Cache-Control': 'no-cache',
|
|
54
|
+ 'Ds-Host': dsHost,
|
51
|
55
|
},
|
52
|
56
|
success(res) {
|
53
|
57
|
resolve(res.data);
|
|
@@ -71,7 +75,8 @@ export function deleteIt(url, data = {}) {
|
71
|
75
|
url,
|
72
|
76
|
data,
|
73
|
77
|
header: {
|
74
|
|
- 'Cache-Control': 'no-cache'
|
|
78
|
+ 'Cache-Control': 'no-cache',
|
|
79
|
+ 'Ds-Host': dsHost,
|
75
|
80
|
},
|
76
|
81
|
success(res) {
|
77
|
82
|
resolve(res.data);
|