q-koa 8.1.0 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/core/app.js CHANGED
@@ -133,6 +133,12 @@ class APP {
133
133
  this.app.use(async (ctx, next) => {
134
134
  const verify = util.promisify(jwt.verify)
135
135
  const { url, host, ip, method } = ctx.request
136
+ if (this.config.blackList.includes(ip)) {
137
+ if (this.config.log.request) {
138
+ console.log('IP==>', ip)
139
+ }
140
+ return ctx.ERROR('error')
141
+ }
136
142
  const appName = url.split('/')[1]
137
143
  const { secret, whiteList, _whiteList, tokenKey, expiresIn } =
138
144
  ctx.app[appName] && ctx.app[appName].appConfig
package/core/config.js CHANGED
@@ -8,6 +8,7 @@ module.exports = {
8
8
  log: {
9
9
  request: true,
10
10
  },
11
+ blackList: [],
11
12
  task: {
12
13
  dir: 'task',
13
14
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.1.0",
3
+ "version": "8.1.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {