diff --git a/main.py b/main.py index b484447..f40261f 100644 --- a/main.py +++ b/main.py @@ -1772,7 +1772,10 @@ async def fastapi_get_node_coord(network: str, node: str) -> dict[str, float] | # node type: junction, reservoir, tank # link type: pipe, pump, valve @app.get("/getnetworkgeometries/") -async def fastapi_get_network_geometries(network: str) -> dict[str, Any] | None: +async def fastapi_get_network_geometries(network: str, token: str) -> dict[str, Any] | None: + if token != "567e33c876a2": + raise HTTPException(status_code=401, detail="Unauthorized") + # 获取所有节点坐标# 缓存查询结果提高性能 global redis_client cache_key = f"getnetworkgeometries_{network}"