/**
 * Created by chen on 2017/7/17.
 */



module.exports =function (app) {
    app.get('/main',  function(req, res) {
        let pm = require('../../pm/controllers/pm_controller');
        pm.checkProjectRight(req.session.sessionUser.ssoId, req.query.project, function (hasRight) {
            if (hasRight) {
                res.render('building_saas/main/html/main.html',
                    {
                        userAccount: req.session.userAccount,
                        userID: req.session.sessionUser.ssoId
                    });
            } else {
                res.redirect('/pm');
            }
        });
    });
}
