From fd7c4e3049a3e9ae4d4e2668d08e0985848e0caa Mon Sep 17 00:00:00 2001 From: lanyulei Date: Mon, 3 May 2021 21:20:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=A4=9A=E6=AC=A1=E8=B0=83=E7=94=A8Auth?= =?UTF-8?q?CheckRole=E5=AF=BC=E8=87=B4=E6=95=88=E7=8E=87=E6=85=A2,=20fixes?= =?UTF-8?q?:=20#122?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- router/system/sys_router.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/router/system/sys_router.go b/router/system/sys_router.go index eb5d1a3..e2a836a 100644 --- a/router/system/sys_router.go +++ b/router/system/sys_router.go @@ -30,7 +30,7 @@ func SysNoCheckRoleRouter(r *gin.RouterGroup) { } func RegisterBaseRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { - v1auth := v1.Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) + v1auth := v1.Group("").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { v1auth.GET("/getinfo", system.GetInfo) v1auth.GET("/menurole", system.GetMenuRole) @@ -42,7 +42,7 @@ func RegisterBaseRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddlewar } func RegisterPageRouter(v1 *gin.RouterGroup, authMiddleware *jwt.GinJWTMiddleware) { - v1auth := v1.Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) + v1auth := v1.Group("").Use(authMiddleware.MiddlewareFunc()).Use(middleware.AuthCheckRole()) { v1auth.GET("/deptList", system.GetDeptList) v1auth.GET("/ordinaryDeptList", system.GetOrdinaryDeptList)