账号导入--可以直接打标签

This commit is contained in:
yml2213
2026-08-01 12:24:19 +08:00
parent d417d15d9b
commit 11b249f1fb
6 changed files with 43 additions and 9 deletions
+5 -2
View File
@@ -186,8 +186,11 @@ def import_accounts(
db: Session = Depends(get_db),
current: User = Depends(require_permission("account:import")),
):
"""批量导入账号。格式:用户名|密码|邮箱|邮箱密码|标签(可选)"""
accounts, skipped = parse_and_build_accounts(req.text)
"""批量导入账号。格式:用户名|密码|邮箱|邮箱密码|标签(可选)
req.tag 为统一标签兜底:某行未单独写标签时使用该值,行内标签优先。
"""
accounts, skipped = parse_and_build_accounts(req.text, req.tag)
if accounts:
db.add_all(accounts)