q-koa 8.2.1 → 8.2.2

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.
Files changed (2) hide show
  1. package/core/app.js +5 -2
  2. package/package.json +1 -1
package/core/app.js CHANGED
@@ -18,6 +18,7 @@ const chalk = require('chalk')
18
18
  const { Random } = require('mockjs')
19
19
  const util = require('util')
20
20
  const jwt = require('jsonwebtoken')
21
+ const verify = util.promisify(jwt.verify)
21
22
  const fsExtra = require('fs-extra')
22
23
  const { getObject } = require('./file/utils')
23
24
  const restc = require('./restc')
@@ -131,10 +132,12 @@ class APP {
131
132
  * jwt中间件
132
133
  */
133
134
  this.app.use(async (ctx, next) => {
134
- const verify = util.promisify(jwt.verify)
135
135
  const { url, host, ip, method } = ctx.request
136
136
 
137
- if (ctx.request.header['user-agent'] && ctx.request.header['user-agent'].startsWith('Tencent Security')) {
137
+ if (
138
+ ctx.request.header['user-agent'] &&
139
+ ctx.request.header['user-agent'].startsWith('Tencent Security')
140
+ ) {
138
141
  return ctx.ERROR('error')
139
142
  }
140
143
  if (this.config.blackList.includes(ip)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.2.1",
3
+ "version": "8.2.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {