_initializeJwt (koa) {
let publicKey = fs.readFileSync('src/configurations/rsaKeys/jwtRS256.key.pub', 'utf8')
const jwtMiddleware = jwt({ cookie: 'jwt', secret: publicKey })
.unless({
path: ['/sessions', '/wepay/notification', '/androidVersion', '/send_cellphone_key', '/dataPort', '/send_program_message', '/send_tour_guide_message', '/refund/notification', '/wepay/enterprise_payment', '/onelink_tour_guide_schedule', '/attractions', '/export_consumables', '/shuffling_figure', '/online_guides', '/evaluation', /\/tour_guides\/.+\/create_tour_order/, /\/tour_guides\/.+\/work_order\/.+\/update_slave_device/, /\/tour_guides\/.+\/work_order\/.+\/update_slave_device/, '/meeting/attendance/append']
})
koa.use(jwtMiddleware)
return koa
}
nodejs koa 中 koa-jwt 传参数 无需验证的接口写法
最新推荐文章于 2023-05-29 23:37:00 发布