|
@@ -48,11 +48,11 @@ class API {
|
|
|
try {
|
|
try {
|
|
|
let encryptedKey, encryptedData
|
|
let encryptedKey, encryptedData
|
|
|
if (this.method === 'get') {
|
|
if (this.method === 'get') {
|
|
|
- encryptedKey = req.query.encryptedKey
|
|
|
|
|
- encryptedData = req.query.encryptedData
|
|
|
|
|
|
|
+ encryptedKey = req.query.b
|
|
|
|
|
+ encryptedData = req.query.a
|
|
|
} else {
|
|
} else {
|
|
|
- encryptedKey = req.body.encryptedKey
|
|
|
|
|
- encryptedData = req.body.encryptedData
|
|
|
|
|
|
|
+ encryptedKey = req.body.b
|
|
|
|
|
+ encryptedData = req.body.a
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
if (!encryptedKey || !encryptedData)
|
|
if (!encryptedKey || !encryptedData)
|
|
@@ -119,7 +119,7 @@ class API {
|
|
|
const originalJson = res.json.bind(res)
|
|
const originalJson = res.json.bind(res)
|
|
|
res.json = (data) => {
|
|
res.json = (data) => {
|
|
|
if(this.encrypt && data.data) {
|
|
if(this.encrypt && data.data) {
|
|
|
- data.encryptedData = this.aesEncrypt(data.data, req)
|
|
|
|
|
|
|
+ data.b = this.aesEncrypt(data.data, req)
|
|
|
delete data.data
|
|
delete data.data
|
|
|
}
|
|
}
|
|
|
|
|
|