From 5ec9c7a8ef2110c1ee6315f0a7599feb1c52a029 Mon Sep 17 00:00:00 2001 From: zhl Date: Mon, 10 May 2021 12:46:22 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=9D=E5=AD=98=E7=AE=A1=E7=90=86=E5=91=98?= =?UTF-8?q?=E6=9B=B4=E6=94=B9=E6=97=B6,=20=E5=A6=82=E6=9E=9C=E5=B8=90?= =?UTF-8?q?=E5=8F=B7=E6=98=AF=E7=AE=A1=E7=90=86=E5=91=98=E5=88=99=E5=BF=BD?= =?UTF-8?q?=E7=95=A5username=E7=9A=84=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/controllers/account.controller.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/admin/controllers/account.controller.ts b/src/admin/controllers/account.controller.ts index 9e0163e..2bf9e03 100644 --- a/src/admin/controllers/account.controller.ts +++ b/src/admin/controllers/account.controller.ts @@ -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