From c7f60a01c13ad2f223df54f45ec82abc6e2344a9 Mon Sep 17 00:00:00 2001 From: lan-yonghui Date: Fri, 20 Dec 2024 18:36:05 +0800 Subject: [PATCH] feat: Login to access Swagger documentation --- 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) {