diff --git a/main/xiaozhi-server/app.py b/main/xiaozhi-server/app.py index 0edb475b..48ca8c9c 100644 --- a/main/xiaozhi-server/app.py +++ b/main/xiaozhi-server/app.py @@ -51,8 +51,9 @@ async def main(): # auth_key用于jwt认证,比如视觉分析接口的jwt认证 auth_key = config.get("manager-api", {}).get("secret", "") if not auth_key or len(auth_key) == 0 or "你" in auth_key: - auth_key = str(uuid.uuid4().hex) - config["server"]["auth_key"] = auth_key + if not config["server"]["auth_key"]: + auth_key = str(uuid.uuid4().hex) + config["server"]["auth_key"] = auth_key # 添加 stdin 监控任务 stdin_task = asyncio.create_task(monitor_stdin())