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