koa2-jwt-simple
v1.0.0
Published
koa2 中 jwt 解析验证,直接在响应体里相应状态码和信息
Downloads
1
Readme
koa2-jwt-simple
Install
npm install koa2-jwt-simple
Usage
const Koa = require('koa')
const jwt = require('koa2-jwt-simple')
const app = new Koa()
app.use(jwt({
secret: '生成token时的密匙',
error: {
code: 4008,
msg: '登录失效'
}
}).unless({
path: [/\/api\/register/, /\/api\/login/]
}))