From b2c424a384fa3e77f346ab8acc510e5f4537a11c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AE=87=E5=A4=A9?= Date: Mon, 21 Sep 2020 19:26:38 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4cookie=E4=B8=AD=E9=97=B4?= =?UTF-8?q?=E4=BB=B6,=E6=A4=8D=E5=85=A5request&response=E5=BD=93=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.js | 8 +++----- package.json | 10 +++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/index.js b/index.js index 0d6ced3..8900156 100644 --- a/index.js +++ b/index.js @@ -12,7 +12,6 @@ import fs from 'iofs' // import Ioredis from 'ioredis' import Request from '@gm5/request' import Response from '@gm5/response' -import Cookie from '@gm5/cookie' // import Session from '@gm5/session' import init from './lib/reg-init.js' @@ -20,7 +19,7 @@ import Log from './lib/log.js' //基础日志记录工具 import routerWare from './middleware/router.js' import credentialsWare from './middleware/credentials.js' -// import cookieWare from '@gm5/cookie' + // import sessionWare from './module/session.js' var log = console.log @@ -66,7 +65,6 @@ export default class Five { // 将session和cookie的中间件提到最前 // 以便用户自定义的中间件可以直接操作session和cookie // this.__MIDDLEWARE__.unshift(sessionWare) - this.__MIDDLEWARE__.unshift(Cookie) this.__MIDDLEWARE__.unshift(credentialsWare) this.use(routerWare) @@ -162,7 +160,7 @@ export default class Five { this.__init__() - server = http.createServer(function (req, res) { + server = http.createServer(function(req, res) { var response = new Response(req, res) var request = new Request(req, res) @@ -172,7 +170,7 @@ export default class Five { var fn = middleware.shift() if (fn) { ;(async function next() { - await fn.call(_this, request, response, function () { + await fn.call(_this, request, response, function() { fn = middleware.shift() if (fn) { next() diff --git a/package.json b/package.json index 8597853..d0c7b2c 100644 --- a/package.json +++ b/package.json @@ -6,13 +6,13 @@ "author": "yutent ", "main": "index.js", "dependencies": { - "@gm5/cookie": "^1.0.0", "@gm5/session": "^1.0.0", - "@gm5/request": "^1.0.0", - "@gm5/response": "^1.0.0", + "@gm5/request": "^1.2.0", + "@gm5/response": "^1.3.0", + "@gm5/controller": "^1.0.0", "crypto.js": "^2.0.1", - "es.shim": "^2.0.0", - "iofs": "^2.0.0" + "es.shim": "^2.0.1", + "iofs": "^1.5.0" }, "devDependencies": {}, "repository": {