|
@@ -9,6 +9,7 @@ const api_timeout = 2000; //接口超时时间,默认2s |
|
@@ -9,6 +9,7 @@ const api_timeout = 2000; //接口超时时间,默认2s |
|
9
|
import api from './api.url'
|
9
|
import api from './api.url'
|
|
10
|
import uri_dc from './uri'
|
10
|
import uri_dc from './uri'
|
|
11
|
import bot from './rebot'
|
11
|
import bot from './rebot'
|
|
|
|
12
|
+const sha1=require('js-sha1');
|
|
12
|
|
13
|
|
|
13
|
const server_host = uri_dc.HOST__LINE;
|
14
|
const server_host = uri_dc.HOST__LINE;
|
|
14
|
|
15
|
|
|
@@ -136,7 +137,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr |
|
@@ -136,7 +137,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr |
|
136
|
}
|
137
|
}
|
|
137
|
let stime = new Date();
|
138
|
let stime = new Date();
|
|
138
|
wx.request({
|
139
|
wx.request({
|
|
139
|
- url: host + act,
|
140
|
+ url: host + act+'&'+getSignQuery(),
|
|
140
|
method: 'POST',
|
141
|
method: 'POST',
|
|
141
|
data: data,
|
142
|
data: data,
|
|
142
|
header: {
|
143
|
header: {
|
|
@@ -297,4 +298,18 @@ function msgSecCheck(host,params){ |
|
@@ -297,4 +298,18 @@ function msgSecCheck(host,params){ |
|
297
|
})
|
298
|
})
|
|
298
|
})
|
299
|
})
|
|
299
|
}
|
300
|
}
|
|
|
|
301
|
+function getSignQuery(){
|
|
|
|
302
|
+ let token='HY6FX#X5IXF%TRYnb9Yzfe9qgtSBBYib';
|
|
|
|
303
|
+ let timestamp=parseInt(new Date()/1000).toString()
|
|
|
|
304
|
+ let nonce=Math.random().toString(36).substr(2);
|
|
|
|
305
|
+ nonce+=Math.random().toString(36).substr(2)
|
|
|
|
306
|
+ nonce+=Math.random().toString(36).substr(2);
|
|
|
|
307
|
+ nonce=nonce.toUpperCase()
|
|
|
|
308
|
+ let singArr=[token,nonce,timestamp].sort()
|
|
|
|
309
|
+ console.log('singStr',singArr)
|
|
|
|
310
|
+ let singStr=singArr.join('')
|
|
|
|
311
|
+ console.log('singStr',singStr)
|
|
|
|
312
|
+ let sign=sha1(singStr)
|
|
|
|
313
|
+ return `timestamp=${timestamp}&nonce=${nonce}&sign=${sign}`
|
|
|
|
314
|
+}
|
|
300
|
export default __api(); |
315
|
export default __api(); |