nodejs koa 中 koa-jwt 传参数 无需验证的接口写法

  _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
  }
上一篇:koa+mongDb+arttemplat 实现一个增删改查


下一篇:koa内置对象app