From d195ce9155a0a98b4d2b01cbd1d45bd3fc41460c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=98=AD?= <81747598+lan-yonghui@users.noreply.github.com> Date: Fri, 20 Dec 2024 18:37:59 +0800 Subject: [PATCH] feat: Login to access Swagger documentation (#7496) --- backend/init/router/router.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/init/router/router.go b/backend/init/router/router.go index e1c4eae898dd..d7de8d04c870 100644 --- a/backend/init/router/router.go +++ b/backend/init/router/router.go @@ -175,7 +175,7 @@ func Routers() *gin.Engine { swaggerRouter := Router.Group("1panel") docs.SwaggerInfo.BasePath = "/api/v1" - swaggerRouter.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler)) + swaggerRouter.Use(middleware.JwtAuth()).Use(middleware.SessionAuth()).GET("/swagger/*any", ginSwagger.WrapHandler(swaggerfiles.Handler)) PublicGroup := Router.Group("") { PublicGroup.GET("/health", func(c *gin.Context) {