...
|
...
|
@@ -79,28 +79,28 @@ module.exports = function(req, res, next) { |
|
|
}
|
|
|
//访问路由路径
|
|
|
var path = req.route?req.route.path:filterOriginalUrl(req.originalUrl);
|
|
|
if(req.session.user) {
|
|
|
if(guestAccessList[method+":"+path]){
|
|
|
nextRedirect(method,path);
|
|
|
return;
|
|
|
}
|
|
|
/*判断权限*/
|
|
|
if(path&&req.session.user.allRight[path]){
|
|
|
author.validateAuthor(req.session.user.auth.pid,req.session.user.auth.role_id,path,function(data){
|
|
|
if(data.code!=200){
|
|
|
res.status(403);
|
|
|
res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE});
|
|
|
return;
|
|
|
}
|
|
|
nextRedirect(method,path);
|
|
|
});
|
|
|
}else{
|
|
|
nextRedirect(method,path);
|
|
|
}
|
|
|
}else{
|
|
|
nextRedirect(method,path);
|
|
|
}
|
|
|
|
|
|
// if(req.session.user) {
|
|
|
// if(guestAccessList[method+":"+path]){
|
|
|
// nextRedirect(method,path);
|
|
|
// return;
|
|
|
// }
|
|
|
// /*判断权限*/
|
|
|
// if(path&&req.session.user.allRight[path]){
|
|
|
// author.validateAuthor(req.session.user.auth.pid,req.session.user.auth.role_id,path,function(data){
|
|
|
// if(data.code!=200){
|
|
|
// res.status(403);
|
|
|
// res.render('error/error_nolayout',{message:NO_AUTH,layout:false,cssfile:CSS_FILE});
|
|
|
// return;
|
|
|
// }
|
|
|
// nextRedirect(method,path);
|
|
|
// });
|
|
|
// }else{
|
|
|
// nextRedirect(method,path);
|
|
|
// }
|
|
|
// }else{
|
|
|
// nextRedirect(method,path);
|
|
|
// }
|
|
|
nextRedirect(method,path);
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
|