|
...
|
...
|
@@ -9,6 +9,7 @@ const api_timeout = 2000; //接口超时时间,默认2s |
|
|
|
import api from './api.url'
|
|
|
|
import uri_dc from './uri'
|
|
|
|
import bot from './rebot'
|
|
|
|
const sha1=require('js-sha1');
|
|
|
|
|
|
|
|
const server_host = uri_dc.HOST__LINE;
|
|
|
|
|
|
...
|
...
|
@@ -136,7 +137,7 @@ function rpc(host = '', act, data = {}, fouce = false, header = {}, silence = tr |
|
|
|
}
|
|
|
|
let stime = new Date();
|
|
|
|
wx.request({
|
|
|
|
url: host + act,
|
|
|
|
url: host + act+'&'+getSignQuery(),
|
|
|
|
method: 'POST',
|
|
|
|
data: data,
|
|
|
|
header: {
|
|
...
|
...
|
@@ -297,4 +298,18 @@ function msgSecCheck(host,params){ |
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
function getSignQuery(){
|
|
|
|
let token='HY6FX#X5IXF%TRYnb9Yzfe9qgtSBBYib';
|
|
|
|
let timestamp=parseInt(new Date()/1000).toString()
|
|
|
|
let nonce=Math.random().toString(36).substr(2);
|
|
|
|
nonce+=Math.random().toString(36).substr(2)
|
|
|
|
nonce+=Math.random().toString(36).substr(2);
|
|
|
|
nonce=nonce.toUpperCase()
|
|
|
|
let singArr=[token,nonce,timestamp].sort()
|
|
|
|
console.log('singStr',singArr)
|
|
|
|
let singStr=singArr.join('')
|
|
|
|
console.log('singStr',singStr)
|
|
|
|
let sign=sha1(singStr)
|
|
|
|
return `timestamp=${timestamp}&nonce=${nonce}&sign=${sign}`
|
|
|
|
}
|
|
|
|
export default __api(); |
|
|
\ No newline at end of file |
...
|
...
|
|