fix: Agent二进制路径 /api/agent/bin 避免路由冲突

This commit is contained in:
attacker committed 2026-06-19 01:28:52 +00:00
1 parent 346042a29c
commit cbf4334f7f
2 files changed
+2 -2

No files matched your search

@@ -419,7 +419,7 @@ func (h *AgentInstallHandler) BatchUpgradeAgent(c *gin.Context) {
// 下载新二进制 + 重启服务
upgradeScript := fmt.Sprintf(
`curl -fsSL -o /tmp/aiops-agent %s/agent/bin/%s && chmod +x /tmp/aiops-agent && systemctl stop aiops-agent 2>/dev/null; mv /tmp/aiops-agent /usr/local/bin/aiops-agent && systemctl start aiops-agent && echo "UPGRADE_OK"`,
`curl -fsSL -o /tmp/aiops-agent %s/api/agent/bin/%s && chmod +x /tmp/aiops-agent && systemctl stop aiops-agent 2>/dev/null; mv /tmp/aiops-agent /usr/local/bin/aiops-agent && systemctl start aiops-agent && echo "UPGRADE_OK"`,
serverURL, binaryFile,
)
+1 -1
View File
@@ -459,7 +459,7 @@ func Register(r *gin.Engine, db *gorm.DB, log *zap.Logger, cfg *config.Config, c
}
// Agent 二进制下载(无需鉴权,Agent 升级时使用)
r.Static("/agent/bin", "/app/agent/bin")
r.Static("/api/agent/bin", "/app/agent/bin")
// AI 智能助手 - LLM 配置 + 对话代理(OpenAI 兼容) // Logan.Li
llmHandler := handlers.NewLLMHandler(db)