mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 导入用户:支持tab分隔数据
This commit is contained in:
1 parent
289b4da1fe
commit
b542f92f6a
1 file changed
+2
-1
@@ -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`);
|
||||
|
||||
Reference in new issue
Block a user