function HasRole(role) { return function(req, res, next) { if (role !== req.user.role) res.redirect(...); else next(); }}
function HasRole(role) { return HasRole[role] || (HasRole[role] = function(req, res, next) { if (role !== req.user.role) res.redirect(...); else next(); })}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)