fix: remote agent exec url_path_prefix error

This commit is contained in:
engigu
2026-01-14 10:17:19 +08:00
parent 115010a3ee
commit 82a42fbfc1
+7 -1
View File
@@ -216,6 +216,12 @@ func Setup(c *Controllers) *gin.Engine {
agents.POST("/tokens", c.Agent.CreateToken) agents.POST("/tokens", c.Agent.CreateToken)
agents.DELETE("/tokens/:id", c.Agent.DeleteToken) agents.DELETE("/tokens/:id", c.Agent.DeleteToken)
} }
// Agent API(供前端调用,保持在 v1 下)
agentAPIv1 := authorized.Group("/agent")
{
agentAPIv1.GET("/download", c.Agent.Download)
}
} }
} }
@@ -225,7 +231,7 @@ func Setup(c *Controllers) *gin.Engine {
agentAPI.POST("/heartbeat", c.Agent.Heartbeat) agentAPI.POST("/heartbeat", c.Agent.Heartbeat)
agentAPI.GET("/tasks", c.Agent.GetTasks) agentAPI.GET("/tasks", c.Agent.GetTasks)
agentAPI.POST("/report", c.Agent.ReportResult) agentAPI.POST("/report", c.Agent.ReportResult)
agentAPI.GET("/download", c.Agent.Download) agentAPI.GET("/download", c.Agent.Download) // 也在这里注册,兼容 Agent 调用
agentAPI.GET("/ws", c.Agent.WSConnect) // WebSocket 连接 agentAPI.GET("/ws", c.Agent.WSConnect) // WebSocket 连接
} }