处理 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

View File

@@ -17,4 +17,4 @@ $ ->
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushError error
ErrorHandle.flushError error