处理 404 和 403 的情况

This commit is contained in:
jysperm
2014-04-16 01:18:39 +08:00
parent aae52c6fff
commit 1946203166
2 changed files with 7 additions and 1 deletions

View File

@@ -36,6 +36,12 @@ module.exports =
return res.redirect '/account/login/'
mTicket.findId req.body.id, (ticket) ->
unless ticket
return res.send 404
unless mTicket.hasMember ticket, account
return res.send 403
res.render 'ticket/view',
account: account
ticket: ticket