Dotos 8 gadi atpakaļ
vecāks
revīzija
5a0639770b
4 mainītis faili ar 52 papildinājumiem un 53 dzēšanām
  1. 2 2
      app.js
  2. 47 46
      package.json
  3. 2 4
      utils/Crypto.js
  4. 1 1
      utils/utils.js

+ 2 - 2
app.js

@@ -22,7 +22,7 @@ var mobile = require('./routes/mobile');
 //天气
 var weather = require('./routes/weather');
 //test
-var test = require('./routes/test');
+//var test = require('./routes/test');
 
 var app = express();
 app.set('views', path.join(__dirname, 'views'));
@@ -61,7 +61,7 @@ app.use(favicon(__dirname + '/static/images/favicon.ico'));
 
 
 app.use('/', welcome);
-app.use('/test', test);
+// app.use('/test', test);
 app.use('/ip', ip);
 app.use('/v1', v1);
 app.use('/netease', netease);

+ 47 - 46
package.json

@@ -1,47 +1,48 @@
 {
-    "name": "JsonBird",
-    "version": "1.4.0",
-    "description": "A remote data interface proxy service",
-    "author": {
-        "name": "xCss",
-        "mail": "yy.liu@foxmail.com"
-    },
-    "license": "MIT",
-    "private": true,
-    "scripts": {
-        "start": "supervisor node ./bin/www",
-        "super": "supervisor ./bin/www"
-    },
-    "repository": {
-        "type": "git",
-        "url": "git+https://github.com/xCss/JsonBird.git"
-    },
-    "keywords": [
-        "JsonBird",
-        "proxy",
-        "data interface proxy",
-        "remote data interface proxy"
-    ],
-    "bugs": {
-        "url": "https://github.com/xCss/JsonBird/issues"
-    },
-    "readme": "./readme.md",
-    "homepage": "https://github.com/xCss/JsonBird#readme",
-    "dependencies": {
-        "big-integer": "^1.6.17",
-        "blueimp-md5": "^2.7.0",
-        "body-parser": "~1.15.1",
-        "cookie-parser": "~1.4.3",
-        "debug": "~2.2.0",
-        "express": "~4.13.4",
-        "express-generator": "^4.13.4",
-        "helmet": "^2.3.0",
-        "js-base64": "^2.1.9",
-        "morgan": "~1.7.0",
-        "pug": "^2.0.0-beta6",
-        "querystring": "^0.2.0",
-        "request": "^2.81.0",
-        "serve-favicon": "~2.3.0",
-        "superagent": "^2.3.0"
-    }
-}
+  "name": "JsonBird",
+  "version": "1.4.0",
+  "description": "A remote data interface proxy service",
+  "author": {
+    "name": "xCss",
+    "mail": "yy.liu@foxmail.com"
+  },
+  "license": "MIT",
+  "private": true,
+  "scripts": {
+    "start": "supervisor node ./bin/www",
+    "super": "supervisor ./bin/www"
+  },
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/xCss/JsonBird.git"
+  },
+  "keywords": [
+    "JsonBird",
+    "proxy",
+    "data interface proxy",
+    "remote data interface proxy"
+  ],
+  "bugs": {
+    "url": "https://github.com/xCss/JsonBird/issues"
+  },
+  "readme": "./readme.md",
+  "homepage": "https://github.com/xCss/JsonBird#readme",
+  "dependencies": {
+    "big-integer": "^1.6.17",
+    "blueimp-md5": "^2.7.0",
+    "body-parser": "~1.15.1",
+    "cookie-parser": "~1.4.3",
+    "crypto": "0.0.3",
+    "debug": "~2.2.0",
+    "express": "~4.13.4",
+    "express-generator": "^4.13.4",
+    "helmet": "^2.3.0",
+    "js-base64": "^2.1.9",
+    "morgan": "~1.7.0",
+    "pug": "^2.0.0-beta6",
+    "querystring": "^0.2.0",
+    "request": "^2.81.0",
+    "serve-favicon": "~2.3.0",
+    "superagent": "^2.3.0"
+  }
+}

+ 2 - 4
utils/Crypto.js

@@ -52,7 +52,7 @@ function rsaEncrypt(text, pubKey, modulus) {
     return zfill(biRet.toString(16), 256)
 }
 
-function Encrypt(obj) {
+const Encrypt = (obj) => {
     const text = JSON.stringify(obj)
     const secKey = createSecretKey(16)
     const encText = aesEncrypt(aesEncrypt(text, nonce), secKey)
@@ -63,6 +63,4 @@ function Encrypt(obj) {
     }
 }
 
-module.exports = {
-    Encrypt
-}
+module.exports = Encrypt

+ 1 - 1
utils/utils.js

@@ -1,4 +1,4 @@
-const Encrypt = require('crypto.js');
+const Encrypt = require('./crypto.js');
 const request = require('request');
 const qs = require('querystring');