From 6904e4993f08c7596ce7425bcdf059c9981e07a9 Mon Sep 17 00:00:00 2001 From: lxh2875931338 Date: Tue, 28 Jul 2026 20:38:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BB=B6=E8=BF=9F=E7=9B=91=E6=B5=8B=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/api.go b/api.go index 2f746f4..2e59b3f 100644 --- a/api.go +++ b/api.go @@ -45,10 +45,13 @@ func SetupRouter() *gin.Engine { api := r.Group("/api") { + // ---- 公开路由(不需要认证) ---- api.GET("/check/users", checkUsersHandler) api.POST("/register", registerHandler) api.POST("/login", loginHandler) + api.GET("/ping", pingHandler) // ← 移到这里 + // ---- 需要认证的路由 ---- auth := api.Group("/") auth.Use(AuthMiddleware()) { @@ -66,7 +69,7 @@ func SetupRouter() *gin.Engine { auth.POST("/frpc/stop", stopFrpcHandler) auth.GET("/frpc/status", getFrpcStatusHandler) auth.GET("/frpc/log", getFrpcLogHandler) - auth.GET("/ping", pingHandler) + auth.POST("/import/toml", importTomlHandler) auth.GET("/export/toml", ExportTomlHandler)