/**
 * 登录路由分发
 *
 * @author CaiAoLin
 * @date 2017/6/1
 * @version
 */
import express from "express";
import LoginController from "../controllers/login_controller";


module.exports = function (app) {
    let  router = express.Router();
    let loginController = new LoginController();
    // 登录页面action
    router.get('/login', loginController.index);
    router.get('/', loginController.index);

// 登录操作
    router.post('/login', loginController.login);

    router.get("/logout", function (req, res) {
        delete req.session.sessionUser;
        res.redirect("/");
    });
    app.use('/',router)
};
