保存管理员更改时, 如果帐号是管理员则忽略username的修改
This commit is contained in:
parent
aaeba429ad
commit
5ec9c7a8ef
@ -51,10 +51,7 @@ class AccountController extends BaseController {
|
||||
account = new Admin()
|
||||
account.level = 9
|
||||
}
|
||||
if (username) {
|
||||
if (ADMINS.indexOf(username) >= 0) {
|
||||
throw new ZError(20, 'can not change admin username')
|
||||
}
|
||||
if (username && ADMINS.indexOf(username) == -1) {
|
||||
account.username = username
|
||||
}
|
||||
let admin = req.user
|
||||
|
Loading…
x
Reference in New Issue
Block a user