前后端更新
This commit is contained in:
1 parent
a0c8721fbb
commit
24da604727
33 files changed
+1951
-580
No files matched your search
@@ -29,6 +29,16 @@ def list_user_agents():
|
||||
agents = [a for a in user.agents if a.is_active]
|
||||
|
||||
# 序列化为前端所需字段
|
||||
|
||||
@agents_bp.route('/public', methods=['GET'])
|
||||
def list_public_agents():
|
||||
"""
|
||||
获取公开的 Agent 列表 (无需登录)
|
||||
用途:登录页面展示
|
||||
"""
|
||||
# 返回所有激活的 Agent,包含基本信息
|
||||
agents = Agent.query.filter_by(is_active=True).order_by(Agent.id.asc()).all()
|
||||
|
||||
data = [
|
||||
{
|
||||
'id': a.id,
|
||||
@@ -40,3 +50,4 @@ def list_user_agents():
|
||||
]
|
||||
return jsonify(data)
|
||||
|
||||
|
||||
Reference in new issue
Block a user