fix(douyu): 账号标签列表按用户可见范围过滤 & 导入弹窗切换筛选时清空已选

This commit is contained in:
yml2213
2026-08-06 14:11:48 +08:00
parent 25880e91a7
commit f8de495029
3 changed files with 11 additions and 3 deletions
+8 -2
View File
@@ -377,8 +377,14 @@ def list_tags(
db: Session = Depends(get_db),
current: User = Depends(get_current_user),
):
"""获取所有标签列表。"""
tags = db.query(Account.tag).filter(Account.tag != "", Account.tag.isnot(None)).distinct().all()
"""获取当前用户可见账号的标签列表。"""
query = _visible_accounts_query(db, current)
tags = (
query.filter(Account.tag != "", Account.tag.isnot(None))
.with_entities(Account.tag)
.distinct()
.all()
)
return [t[0] for t in tags if t[0]]