report_router.js 948 B

1234567891011121314151617181920212223242526272829
  1. /**
  2. * Created by Tony on 2017/3/13.
  3. */
  4. let express = require('express');
  5. let rptRouter = express.Router();
  6. let reportController = require('./../controllers/rpt_controller');
  7. <<<<<<< HEAD
  8. rptRouter.post('/getReport', reportController.getReportAllPages);
  9. rptRouter.get('/getExcel/:id/:size/:rptName/:isOneSheet', reportController.getExcel);
  10. =======
  11. module.exports =function (app) {
  12. >>>>>>> 54307e7bc954a6c634a9960dab54b0f42578bc0f
  13. app.get('/report', function(req, res) {
  14. if (!req.session.userAccount) {
  15. res.redirect('/login');
  16. }
  17. else {
  18. res.render('maintain/report/rpt_test.html',
  19. {userAccount: req.session.userAccount,
  20. userID: req.session.userID});
  21. }
  22. });
  23. rptRouter.post('/getReport', reportController.getReportAllPages);
  24. rptRouter.get('/getExcel/:id/:size/:rptName', reportController.getExcel);
  25. app.use("/report_api", rptRouter);
  26. }