const { LoginController } = require('../controller')

module.exports.loginRouter = function (router) {
  router.all('/login/getCode', async (ctx, next) => {
    await next()
    await LoginController.getCode(ctx)
  })

  router.all('/login/checkCode', async (ctx, next) => {
    await next()
    await LoginController.checkCode(ctx)
  })

  router.all('/login/auth', async (ctx, next) => {
    await next()
    await LoginController.authUser(ctx)
  })
}
