From b542f92f6a04c965beec662b1bb70b7eaa1226ad Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 1 Aug 2021 16:22:09 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E5=AF=BC=E5=85=A5=E7=94=A8=E6=88=B7?= =?UTF-8?q?=EF=BC=9A=E6=94=AF=E6=8C=81tab=E5=88=86=E9=9A=94=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrooj/src/handler/manage.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/hydrooj/src/handler/manage.ts b/packages/hydrooj/src/handler/manage.ts index 8f909c04b..a7781e7be 100644 --- a/packages/hydrooj/src/handler/manage.ts +++ b/packages/hydrooj/src/handler/manage.ts @@ -198,7 +198,8 @@ class SystemUserImportHandler extends SystemHandler { for (const i in users) { const u = users[i]; if (!u.trim()) continue; - const [email, username, password, displayName] = u.split(',').map((t) => t.trim()); + let [email, username, password, displayName] = u.split(',').map((t) => t.trim()); + if (!email || !username || !password) [email, username, password, displayName] = u.split('\t').map((t) => t.trim()); if (email && username && password) { if (!isEmail(email)) messages.push(`Line ${+i + 1}: Invalid email.`); else if (!isUname(username)) messages.push(`Line ${+i + 1}: Invalid username`);