feat: 添加租户工具配置系统
All checks were successful
continuous-integration/drone/push Build is passing

- 新增 platform_tool_configs 表和 ToolConfig Model
- 新增工具配置 CRUD API (/api/tool-configs)
- 租户详情页添加工具配置管理 Tab
- 修复查看 Token 显示问题,添加专用获取接口
This commit is contained in:
2026-01-27 11:30:02 +08:00
parent 8e675c207d
commit 7134947c0c
7 changed files with 901 additions and 55 deletions

View File

@@ -164,6 +164,27 @@ async def delete_tenant_app(
return {"success": True}
@router.get("/{app_id}/token")
async def get_token(
app_id: int,
user: User = Depends(require_operator),
db: Session = Depends(get_db)
):
"""获取真实的 access_token仅管理员可用"""
app = db.query(TenantApp).filter(TenantApp.id == app_id).first()
if not app:
raise HTTPException(status_code=404, detail="应用配置不存在")
# 获取应用的 base_url
app_info = db.query(App).filter(App.app_code == app.app_code).first()
base_url = app_info.base_url if app_info else ""
return {
"access_token": app.access_token,
"base_url": base_url
}
@router.post("/{app_id}/regenerate-token")
async def regenerate_token(
app_id: int,