auth.js 328 Bytes Raw Blame History Permalink 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 /** * controller 入口 * @author: feng.chen<feng.chen@yoho.cn> * @date: 2017/04/13 */ module.exports = (req, res, next) => { if (!req.user.uid) { return res.json({ code: 401, message: '抱歉,您暂未登录!', redirect: '/signin.html' }); } next(); };