mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-01-13 07:01:20 +08:00
fix admin
This commit is contained in:
@@ -11,10 +11,7 @@ Request:
|
||||
"order_id": "560097131641814"
|
||||
}
|
||||
|
||||
Response:
|
||||
|
||||
{}
|
||||
|
||||
Exception:
|
||||
|
||||
* account_not_exist
|
||||
* invalid_amount
|
||||
|
||||
@@ -3,12 +3,6 @@ module.exports =
|
||||
url: 'http://rp3.rpvhost.net'
|
||||
port: 3000
|
||||
|
||||
debug:
|
||||
mock_test: false
|
||||
|
||||
admin:
|
||||
username: ['jysperm']
|
||||
|
||||
account:
|
||||
invalid_username: [
|
||||
'root', 'daemon', 'bin', 'sys', 'sync', 'games', 'man', 'lp', 'mail', 'colord', 'nobody',
|
||||
|
||||
@@ -5,7 +5,7 @@ mAccount = require '../model/account'
|
||||
module.exports = exports = express.Router()
|
||||
|
||||
exports.get '/', requestAdminAuthenticate, renderAccount, (req, res) ->
|
||||
mAccount.find({}).toArray (err, accounts) ->
|
||||
mAccount.find().toArray (err, accounts) ->
|
||||
res.render 'admin/index',
|
||||
accounts: accounts
|
||||
|
||||
@@ -15,7 +15,9 @@ exports.post '/create_payment', requestAdminAuthenticate, (req, res) ->
|
||||
return res.error 'account_not_exist'
|
||||
|
||||
amount = parseFloat req.body.amount
|
||||
amount = 0 unless _.isNaN amount
|
||||
|
||||
if _.isNaN amount
|
||||
return res.error 'invalid_amount'
|
||||
|
||||
mAccount.incBalance account, 'deposit', amount,
|
||||
type: req.body.type
|
||||
|
||||
@@ -32,6 +32,9 @@ html
|
||||
a= account.username
|
||||
li
|
||||
a(href='/panel/')= t('panel.')
|
||||
if mAccount.inGroup(account, 'root')
|
||||
li
|
||||
a(href='/admin/') 管理员面板
|
||||
li
|
||||
a#logout(href='/account/logout/')= t('account.logout')
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user