mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-29 22:20:30 +08:00
处理 404 和 403 的情况
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -17,4 +17,4 @@ $ ->
|
||||
.fail (reply) ->
|
||||
if reply.status is 400
|
||||
error = reply.responseJSON.error
|
||||
ErrorHandle.flushError error
|
||||
ErrorHandle.flushError error
|
||||
|
||||
Reference in New Issue
Block a user