|
@@ -1,7 +1,12 @@
|
1
|
|
-export const path = `${location.origin}/service`
|
2
|
1
|
// #ifdef H5
|
3
|
2
|
import wx from 'weixin-jsapi'
|
4
|
3
|
// #endif
|
|
4
|
+let dsHost = "";
|
|
5
|
+// #ifdef H5
|
|
6
|
+dsHost = location.hostname;
|
|
7
|
+// #endif
|
|
8
|
+
|
|
9
|
+export const path = `${location.origin}/service`
|
5
|
10
|
// get方法
|
6
|
11
|
export function get(url, data = {}) {
|
7
|
12
|
url = path + url;
|
|
@@ -10,7 +15,8 @@ export function get(url, data = {}) {
|
10
|
15
|
url,
|
11
|
16
|
data,
|
12
|
17
|
header: {
|
13
|
|
- 'Cache-Control': 'no-cache'
|
|
18
|
+ 'Cache-Control': 'no-cache',
|
|
19
|
+ 'Ds-Host': dsHost,
|
14
|
20
|
},
|
15
|
21
|
success(res) {
|
16
|
22
|
if(res.statusCode === 200){
|
|
@@ -42,7 +48,8 @@ export function post(url, data = {}) {
|
42
|
48
|
url,
|
43
|
49
|
data,
|
44
|
50
|
header: {
|
45
|
|
- 'Cache-Control': 'no-cache'
|
|
51
|
+ 'Cache-Control': 'no-cache',
|
|
52
|
+ 'Ds-Host': dsHost,
|
46
|
53
|
},
|
47
|
54
|
success(res) {
|
48
|
55
|
if(res.statusCode === 200){
|