Authored by weiqingting

去掉 admin.protorl.com 的验证

... ... @@ -42,23 +42,24 @@ exports.post = function(data, req, res) {
}
}
req.app.logger.log('verbose','gray login options:',options);
request(options,function(err,ress,body){
if(!err) {
//cookie透传到老系统
var cookie = ress.caseless.get('set-cookie');
req.app.logger.log('verbose','login old server response http headers:',ress.caseless);
req.app.logger.log('verbose','login gray cookie:',cookie);
//如果没有设置到session
if(cookie && cookie.length>0) {
req.session.gray = cookie[0];
}
//跳转
res.redirect(url);
// request(options,function(err,ress,body){
// if(!err) {
// //cookie透传到老系统
// var cookie = ress.caseless.get('set-cookie');
// req.app.logger.log('verbose','login old server response http headers:',ress.caseless);
// req.app.logger.log('verbose','login gray cookie:',cookie);
// //如果没有设置到session
// if(cookie && cookie.length>0) {
// req.session.gray = cookie[0];
// }
// //跳转
// res.redirect(url);
} else {
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false,cssfile:CSS_FILE});
}
});
// } else {
// res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false,cssfile:CSS_FILE});
// }
// });
res.redirect(url);
return;
} else {
... ...
... ... @@ -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);
}
/**
... ...
... ... @@ -97,11 +97,7 @@
<label class="col-sm-2 control-label">封面图:<span class="red">*</span> </label>
<div class="col-sm-8">
<<<<<<< HEAD
<input type="file" name="coverImage" id="coverImage" value="[[coverImage]]" required placeholder="封面图"/>
=======
<input type="file" name="coverImage" id="coverImage" required="required" value="[[coverImage]]" />
>>>>>>> develop
</div>
</div>
<div class="form-group">
... ...