保存管理员更改时, 如果帐号是管理员则忽略username的修改

This commit is contained in:
zhl 2021-05-10 12:46:22 +08:00
parent aaeba429ad
commit 5ec9c7a8ef

View File

@ -51,10 +51,7 @@ class AccountController extends BaseController {
account = new Admin() account = new Admin()
account.level = 9 account.level = 9
} }
if (username) { if (username && ADMINS.indexOf(username) == -1) {
if (ADMINS.indexOf(username) >= 0) {
throw new ZError(20, 'can not change admin username')
}
account.username = username account.username = username
} }
let admin = req.user let admin = req.user