fix: 为Java项目的OTA接口实现WebSocket认证token生成功能,确保与Python端完全兼容。

This commit is contained in:
panjingpeng
2025-12-11 16:08:45 +08:00
parent fe0a6852e9
commit 5ac1a1d6a5
3 changed files with 59 additions and 1 deletions
@@ -68,6 +68,7 @@ async def get_config_from_api_async(config):
"url": config["manager-api"].get("url", ""),
"secret": config["manager-api"].get("secret", ""),
}
auth_enabled = config_data.get("server", {}).get("auth", {}).get("enabled", False)
# server的配置以本地为准
if config.get("server"):
config_data["server"] = {
@@ -77,6 +78,7 @@ async def get_config_from_api_async(config):
"vision_explain": config["server"].get("vision_explain", ""),
"auth_key": config["server"].get("auth_key", ""),
}
config_data["server"]["auth"] = {"enabled": auth_enabled}
# 如果服务器没有prompt_template,则从本地配置读取
if not config_data.get("prompt_template"):
config_data["prompt_template"] = config.get("prompt_template")