Skip to content

Commit

Permalink
Add sign up
Browse files Browse the repository at this point in the history
  • Loading branch information
DesertsP committed Oct 24, 2018
1 parent a98ecc9 commit b11fe9e
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,15 @@ app.use('/sign-up', require('./routes/sign-up'));

// 处理登录请求(可能来自登录界面中的表单)
app.post('/login', function (req, res) {

AV.User.logIn(req.body.username, req.body.password).then(function (user) {
let adminMail = process.env.BLOGGER_EMAIL || process.env.SMTP_USER;
console.log(user.get('email'));
if (user.get('email') === adminMail) {
res.saveCurrentUser(user); // 保存当前用户到 Cookie
res.redirect('/comments');
}

else {
res.redirect('/');
}

}, function (error) {
//登录失败,跳转到登录页面
res.redirect('/');
Expand Down

0 comments on commit b11fe9e

Please sign in to comment.