增加缓存机制

This commit is contained in:
binaryify
2017-08-17 10:57:18 +08:00
parent 2bccab0e73
commit a91bae2e86
20 changed files with 281 additions and 461 deletions

View File

@ -1,5 +1,7 @@
const Encrypt = require('./crypto.js')
const http = require('http')
const querystring = require('querystring')
function randomUserAgent() {
const userAgentList = [
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36',
@ -79,7 +81,10 @@ function createWebAPIRequest(
}
)
http_client.write(
'params=' + cryptoreq.params + '&encSecKey=' + cryptoreq.encSecKey
querystring.stringify({
params: cryptoreq.params,
encSecKey: cryptoreq.encSecKey
})
)
http_client.end()
}
@ -121,4 +126,4 @@ function createRequest(path, method, data, callback, errorcallback) {
module.exports = {
createWebAPIRequest,
createRequest
}
}