mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-29 03:55:42 +08:00
管理员面板前端页面
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
mAccount = require '../model/account'
|
||||
|
||||
module.exports =
|
||||
get:
|
||||
'/admin/': (req, res) ->
|
||||
mAccount.authenticate req.token, (account) ->
|
||||
unless account
|
||||
return res.redirect '/account/login/'
|
||||
|
||||
unless mAccount.inGroup account, 'root'
|
||||
return res.send 403
|
||||
|
||||
mAccount.find {}, {}, (accounts) ->
|
||||
res.render 'admin/index',
|
||||
account: account
|
||||
accounts: accounts
|
||||
|
||||
post:{}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
exports.bind = (app) ->
|
||||
for item in ['account', 'panel', 'ticket']
|
||||
for item in ['account', 'panel', 'ticket', 'admin']
|
||||
apiModule = require('./' + item)
|
||||
|
||||
generateUrl = (name) ->
|
||||
|
||||
Reference in New Issue
Block a user