user.js 485 B

123456789101112
  1. 'use strict';
  2. module.exports = app => {
  3. const { router, controller } = app;
  4. const profix = '/api/hc/';
  5. const target = 'user';
  6. router.post(target, `${profix}${target}/login`, controller[target].login);
  7. router.post(target, `${profix}${target}/password`, controller[target].password);
  8. router.resources(target, `${profix}${target}`, controller[target]); // index、create、show、destroy
  9. router.post(target, `${profix}${target}/update/:id`, controller[target].update);
  10. };