seimin 1 year ago
parent
commit
fac49e4cce
3 changed files with 17 additions and 0 deletions
  1. 5 0
      http/http.js
  2. 11 0
      package-lock.json
  3. 1 0
      package.json

+ 5 - 0
http/http.js

@@ -1,3 +1,4 @@
1
+import { encode } from 'js-base64';
1
 // #ifdef H5
2
 // #ifdef H5
2
 import wx from 'weixin-jsapi'
3
 import wx from 'weixin-jsapi'
3
 // #endif
4
 // #endif
@@ -35,6 +36,10 @@ export function get(url, data = {}) {
35
 }
36
 }
36
 // post方法
37
 // post方法
37
 export function post(url, data = {}) {
38
 export function post(url, data = {}) {
39
+  if(url.includes('/workerOrder/orderSign/')){
40
+    let code = url.replace('/workerOrder/orderSign/', '');
41
+    url = '/workerOrder/orderSign/' + encode(code);
42
+  }
38
   url = path + url;
43
   url = path + url;
39
   return new Promise((resolve, reject) => {
44
   return new Promise((resolve, reject) => {
40
     uni.request({
45
     uni.request({

+ 11 - 0
package-lock.json

@@ -11,6 +11,7 @@
11
       "dependencies": {
11
       "dependencies": {
12
         "crypto-js": "^4.1.1",
12
         "crypto-js": "^4.1.1",
13
         "eruda": "^3.0.1",
13
         "eruda": "^3.0.1",
14
+        "js-base64": "^3.7.5",
14
         "spinkit": "^2.0.1",
15
         "spinkit": "^2.0.1",
15
         "vconsole": "^3.14.7",
16
         "vconsole": "^3.14.7",
16
         "weixin-jsapi": "^1.1.0"
17
         "weixin-jsapi": "^1.1.0"
@@ -212,6 +213,11 @@
212
         "has": "^1.0.3"
213
         "has": "^1.0.3"
213
       }
214
       }
214
     },
215
     },
216
+    "node_modules/js-base64": {
217
+      "version": "3.7.5",
218
+      "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz",
219
+      "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
220
+    },
215
     "node_modules/minimatch": {
221
     "node_modules/minimatch": {
216
       "version": "3.0.4",
222
       "version": "3.0.4",
217
       "resolved": "https://registry.npmmirror.com/minimatch/download/minimatch-3.0.4.tgz",
223
       "resolved": "https://registry.npmmirror.com/minimatch/download/minimatch-3.0.4.tgz",
@@ -621,6 +627,11 @@
621
         "has": "^1.0.3"
627
         "has": "^1.0.3"
622
       }
628
       }
623
     },
629
     },
630
+    "js-base64": {
631
+      "version": "3.7.5",
632
+      "resolved": "https://registry.npmmirror.com/js-base64/-/js-base64-3.7.5.tgz",
633
+      "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA=="
634
+    },
624
     "minimatch": {
635
     "minimatch": {
625
       "version": "3.0.4",
636
       "version": "3.0.4",
626
       "resolved": "https://registry.npmmirror.com/minimatch/download/minimatch-3.0.4.tgz",
637
       "resolved": "https://registry.npmmirror.com/minimatch/download/minimatch-3.0.4.tgz",

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
16
   "dependencies": {
16
   "dependencies": {
17
     "crypto-js": "^4.1.1",
17
     "crypto-js": "^4.1.1",
18
     "eruda": "^3.0.1",
18
     "eruda": "^3.0.1",
19
+    "js-base64": "^3.7.5",
19
     "spinkit": "^2.0.1",
20
     "spinkit": "^2.0.1",
20
     "vconsole": "^3.14.7",
21
     "vconsole": "^3.14.7",
21
     "weixin-jsapi": "^1.1.0"
22
     "weixin-jsapi": "^1.1.0"