Browse Source

✨ feat: 加大加密难度

Pchen. 9 months ago
parent
commit
3188ba4406
1 changed files with 5 additions and 5 deletions
  1. 5 5
      lib/API.js

+ 5 - 5
lib/API.js

@@ -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
                 }
                 }